Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 21.5.0

* Add `getScreenshot` method to `Avatars` service

## 21.4.0

* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { Client, Account } from "appwrite";
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:

```html
<script src="https://cdn.jsdelivr.net/npm/appwrite@21.4.0"></script>
<script src="https://cdn.jsdelivr.net/npm/appwrite@21.5.0"></script>
```


Expand Down
32 changes: 32 additions & 0 deletions docs/examples/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Client, Avatars, Theme, Timezone, Output } from "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: {}, // optional
viewportWidth: 1, // optional
viewportHeight: 1, // optional
scale: 0.1, // optional
theme: Theme.Light, // optional
userAgent: '<USER_AGENT>', // optional
fullpage: false, // optional
locale: '<LOCALE>', // optional
timezone: Timezone.AfricaAbidjan, // optional
latitude: -90, // optional
longitude: -180, // optional
accuracy: 0, // optional
touch: false, // optional
permissions: [], // optional
sleep: 0, // optional
width: 0, // optional
height: 0, // optional
quality: -1, // 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": "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": "21.4.0",
"version": "21.5.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.79.2",
"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 @@ -320,7 +320,7 @@ class Client {
'x-sdk-name': 'Web',
'x-sdk-platform': 'client',
'x-sdk-language': 'web',
'x-sdk-version': '21.4.0',
'x-sdk-version': '21.5.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