Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## 26.0.0

* Added: Isomorphic `Client<TAuth>` typed by auth capability — services narrow available methods by auth type at compile time
* Added: Static factory constructors `Client.from`, `Client.fromSession`, `Client.fromAPIKey`, `Client.fromCookie`, `Client.fromJWT`, `Client.fromDevKey`, and `Client.fromImpersonation`
* Added: Server-side auth via `apiKey`, `cookie`, and `jwt` factories
* Added: Admin and server-only endpoints (`Users`, `Projects`, function and site deployments, storage buckets, and more)
* Deprecated: `new Client()` constructor and `setEndpoint`/`setProject`/setter pattern remain for backwards compatibility but are now marked deprecated
* Updated: `x-sdk-platform` header now reflects browser or server runtime

## 25.1.1

* Fixed: Removed `Advisor` service and `Insight`, `InsightCTA`, `InsightList`, `Report`, `ReportList` models (admin-only endpoints, not intended for client SDKs)
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@25.1.1"></script>
<script src="https://cdn.jsdelivr.net/npm/appwrite@26.0.0"></script>
```


Expand Down
15 changes: 15 additions & 0 deletions docs/examples/activities/get-event.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Activities } from "appwrite";

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

const activities = new Activities(client);

const result = await activities.getEvent({
eventId: '<EVENT_ID>'
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/activities/list-events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Activities } from "appwrite";

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

const activities = new Activities(client);

const result = await activities.listEvents({
queries: '' // optional
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/advisor/delete-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Advisor } from "appwrite";

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

const advisor = new Advisor(client);

const result = await advisor.deleteReport({
reportId: '<REPORT_ID>'
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/advisor/get-insight.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Advisor } from "appwrite";

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

const advisor = new Advisor(client);

const result = await advisor.getInsight({
reportId: '<REPORT_ID>',
insightId: '<INSIGHT_ID>'
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/advisor/get-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Advisor } from "appwrite";

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

const advisor = new Advisor(client);

const result = await advisor.getReport({
reportId: '<REPORT_ID>'
});

console.log(result);
```
17 changes: 17 additions & 0 deletions docs/examples/advisor/list-insights.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```javascript
import { Client, Advisor } from "appwrite";

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

const advisor = new Advisor(client);

const result = await advisor.listInsights({
reportId: '<REPORT_ID>',
queries: [], // optional
total: false // optional
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/advisor/list-reports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Advisor } from "appwrite";

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

const advisor = new Advisor(client);

const result = await advisor.listReports({
queries: [], // optional
total: false // optional
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/backups/create-archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Backups, BackupServices } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.createArchive({
services: [BackupServices.Databases],
resourceId: '<RESOURCE_ID>' // optional
});

console.log(result);
```
21 changes: 21 additions & 0 deletions docs/examples/backups/create-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```javascript
import { Client, Backups, BackupServices } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.createPolicy({
policyId: '<POLICY_ID>',
services: [BackupServices.Databases],
retention: 1,
schedule: '',
name: '<NAME>', // optional
resourceId: '<RESOURCE_ID>', // optional
enabled: false // optional
});

console.log(result);
```
18 changes: 18 additions & 0 deletions docs/examples/backups/create-restoration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```javascript
import { Client, Backups, BackupServices } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.createRestoration({
archiveId: '<ARCHIVE_ID>',
services: [BackupServices.Databases],
newResourceId: '<NEW_RESOURCE_ID>', // optional
newResourceName: '<NEW_RESOURCE_NAME>' // optional
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/backups/delete-archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Backups } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.deleteArchive({
archiveId: '<ARCHIVE_ID>'
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/backups/delete-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Backups } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.deletePolicy({
policyId: '<POLICY_ID>'
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/backups/get-archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Backups } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.getArchive({
archiveId: '<ARCHIVE_ID>'
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/backups/get-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Backups } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.getPolicy({
policyId: '<POLICY_ID>'
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/backups/get-restoration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Backups } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.getRestoration({
restorationId: '<RESTORATION_ID>'
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/backups/list-archives.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Backups } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.listArchives({
queries: [] // optional
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/backups/list-policies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Backups } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.listPolicies({
queries: [] // optional
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/backups/list-restorations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Backups } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.listRestorations({
queries: [] // optional
});

console.log(result);
```
19 changes: 19 additions & 0 deletions docs/examples/backups/update-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```javascript
import { Client, Backups } from "appwrite";

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

const backups = new Backups(client);

const result = await backups.updatePolicy({
policyId: '<POLICY_ID>',
name: '<NAME>', // optional
retention: 1, // optional
schedule: '', // optional
enabled: false // optional
});

console.log(result);
```
22 changes: 22 additions & 0 deletions docs/examples/databases/create-big-int-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```javascript
import { Client, Databases } from "appwrite";

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

const databases = new Databases(client);

const result = await databases.createBigIntAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
min: null, // optional
max: null, // optional
xdefault: null, // optional
array: false // optional
});

console.log(result);
```
20 changes: 20 additions & 0 deletions docs/examples/databases/create-boolean-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```javascript
import { Client, Databases } from "appwrite";

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

const databases = new Databases(client);

const result = await databases.createBooleanAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
xdefault: false, // optional
array: false // optional
});

console.log(result);
```
Loading