Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .gitpod.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change log

## 0.19.0

* Add `getScreenshot` method to `Avatars` service
* Add `Theme`, `Timezone` and `Output` enums

## 0.18.0

* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance
Expand Down
35 changes: 35 additions & 0 deletions docs/examples/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Client, Avatars, Theme, Timezone, Output } from "react-native-appwrite";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const avatars = new Avatars(client);

const result = avatars.getScreenshot({
url: 'https://example.com',
headers: {
"Authorization": "Bearer token123",
"X-Custom-Header": "value"
}, // optional
viewportWidth: 1920, // optional
viewportHeight: 1080, // optional
scale: 2, // optional
theme: Theme.Light, // optional
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
fullpage: true, // optional
locale: 'en-US', // optional
timezone: Timezone.AfricaAbidjan, // optional
latitude: 37.7749, // optional
longitude: -122.4194, // optional
accuracy: 100, // optional
touch: true, // optional
permissions: ["geolocation","notifications"], // optional
sleep: 3, // optional
width: 800, // optional
height: 600, // optional
quality: 85, // optional
output: Output.Jpg // optional
});

console.log(result);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "react-native-appwrite",
"homepage": "https://appwrite.io/support",
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
"version": "0.18.0",
"version": "0.19.0",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
Expand All @@ -26,7 +26,7 @@
},
"devDependencies": {
"@rollup/plugin-typescript": "8.3.2",
"playwright": "1.15.0",
"playwright": "1.56.1",
"rollup": "2.75.4",
"serve-handler": "6.1.0",
"tslib": "2.4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class Client {
'x-sdk-name': 'React Native',
'x-sdk-platform': 'client',
'x-sdk-language': 'reactnative',
'x-sdk-version': '0.18.0',
'x-sdk-version': '0.19.0',
'X-Appwrite-Response-Format': '1.8.0',
};

Expand Down
9 changes: 9 additions & 0 deletions src/enums/output.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export enum Output {
Jpg = 'jpg',
Jpeg = 'jpeg',
Png = 'png',
Webp = 'webp',
Heic = 'heic',
Avif = 'avif',
Gif = 'gif',
}
4 changes: 4 additions & 0 deletions src/enums/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum Theme {
Light = 'light',
Dark = 'dark',
}
Loading