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
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# 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)
* Breaking: Renamed `Presences.update` to `Presences.updatePresence`
* Breaking: `Presences.upsert` and `Presences.updatePresence` now require a `userId` parameter
* Deprecated: `new Client()` constructor and `setEndpoint`/`setProject`/setter pattern remain for backwards compatibility but are now marked deprecated

### Migration

```ts
// Before (25.x)
await presences.upsert(presenceId, status);
await presences.update(presenceId, status);

// After (26.0.0)
await presences.upsert(presenceId, userId, status);
await presences.updatePresence(presenceId, userId, status);
```

## 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
10 changes: 6 additions & 4 deletions docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

const result = await account.createAnonymousSession();


console.log(result);
```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

Expand All @@ -13,4 +14,4 @@ const result = await account.createEmailPasswordSession({
});

console.log(result);
```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

Expand All @@ -14,4 +15,4 @@ const result = await account.createEmailToken({
});

console.log(result);
```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-email-verification.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

Expand All @@ -12,4 +13,4 @@ const result = await account.createEmailVerification({
});

console.log(result);
```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-jwt.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

Expand All @@ -12,4 +13,4 @@ const result = await account.createJWT({
});

console.log(result);
```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

Expand All @@ -15,4 +16,4 @@ const result = await account.createMagicURLToken({
});

console.log(result);
```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-mfa-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account, AuthenticatorType } from "appwrite";

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

const account = new Account(client);

Expand All @@ -12,4 +13,4 @@ const result = await account.createMFAAuthenticator({
});

console.log(result);
```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account, AuthenticationFactor } from "appwrite";

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

const account = new Account(client);

Expand All @@ -12,4 +13,4 @@ const result = await account.createMFAChallenge({
});

console.log(result);
```
```
10 changes: 6 additions & 4 deletions docs/examples/account/create-mfa-recovery-codes.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

const result = await account.createMFARecoveryCodes();


console.log(result);
```
```
10 changes: 5 additions & 5 deletions docs/examples/account/create-o-auth-2-session.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account, OAuthProvider } from "appwrite";

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

const account = new Account(client);

Expand All @@ -13,5 +14,4 @@ account.createOAuth2Session({
failure: 'https://example.com', // optional
scopes: [] // optional
});

```
```
10 changes: 5 additions & 5 deletions docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account, OAuthProvider } from "appwrite";

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

const account = new Account(client);

Expand All @@ -13,5 +14,4 @@ account.createOAuth2Token({
failure: 'https://example.com', // optional
scopes: [] // optional
});

```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-phone-token.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

Expand All @@ -13,4 +14,4 @@ const result = await account.createPhoneToken({
});

console.log(result);
```
```
10 changes: 6 additions & 4 deletions docs/examples/account/create-phone-verification.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

const result = await account.createPhoneVerification();


console.log(result);
```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-push-target.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

Expand All @@ -14,4 +15,4 @@ const result = await account.createPushTarget({
});

console.log(result);
```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-recovery.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

Expand All @@ -13,4 +14,4 @@ const result = await account.createRecovery({
});

console.log(result);
```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-session.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

Expand All @@ -13,4 +14,4 @@ const result = await account.createSession({
});

console.log(result);
```
```
9 changes: 5 additions & 4 deletions docs/examples/account/create-verification.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
```javascript
import { Client, Account } from "appwrite";

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

const account = new Account(client);

Expand All @@ -12,4 +13,4 @@ const result = await account.createVerification({
});

console.log(result);
```
```
Loading