|
| 1 | +const sdk = require('node-appwrite'); |
| 2 | + |
| 3 | +const client = new sdk.Client() |
| 4 | + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint |
| 5 | + .setProject('<YOUR_PROJECT_ID>') // Your project ID |
| 6 | + .setSession(''); // The user session to authenticate with |
| 7 | + |
| 8 | +const avatars = new sdk.Avatars(client); |
| 9 | + |
| 10 | +const result = await avatars.getScreenshot({ |
| 11 | + url: 'https://example.com', |
| 12 | + headers: { |
| 13 | + "Authorization": "Bearer token123", |
| 14 | + "X-Custom-Header": "value" |
| 15 | + }, // optional |
| 16 | + viewportWidth: 1920, // optional |
| 17 | + viewportHeight: 1080, // optional |
| 18 | + scale: 2, // optional |
| 19 | + theme: sdk.Theme.Light, // optional |
| 20 | + userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional |
| 21 | + fullpage: true, // optional |
| 22 | + locale: 'en-US', // optional |
| 23 | + timezone: sdk.Timezone.AfricaAbidjan, // optional |
| 24 | + latitude: 37.7749, // optional |
| 25 | + longitude: -122.4194, // optional |
| 26 | + accuracy: 100, // optional |
| 27 | + touch: true, // optional |
| 28 | + permissions: ["geolocation","notifications"], // optional |
| 29 | + sleep: 3, // optional |
| 30 | + width: 800, // optional |
| 31 | + height: 600, // optional |
| 32 | + quality: 85, // optional |
| 33 | + output: sdk.Output.Jpg // optional |
| 34 | +}); |
0 commit comments