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

## 15.2.0

* Added: Realtime connections now send the configured JWT for authentication.

Comment thread
greptile-apps[bot] marked this conversation as resolved.
## 15.1.1

* Breaking: Removed `getQueuePriorityBuilds` from `Health` along with the `/health/queue/builds-priority` endpoint
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.io/console";
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.io/console@15.1.1"></script>
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@15.2.0"></script>
```


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@appwrite.io/console",
"homepage": "https://appwrite.io/support",
"description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
"version": "15.1.1",
"version": "15.2.0",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
Expand Down
8 changes: 6 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class Client {
'x-sdk-name': 'Console',
'x-sdk-platform': 'console',
'x-sdk-language': 'web',
'x-sdk-version': '15.1.1',
'x-sdk-version': '15.2.0',
'X-Appwrite-Response-Format': '1.9.5',
};

Expand Down Expand Up @@ -717,7 +717,11 @@ class Client {

const encodedProject = encodeURIComponent((this.config.project as string) ?? '');
// URL carries only the project; channels/queries are sent via subscribe message.
const queryParams = 'project=' + encodedProject;
let queryParams = 'project=' + encodedProject;

if (this.config.jwt) {
queryParams += '&jwt=' + encodeURIComponent(this.config.jwt as string);
}

const url = this.config.endpointRealtime + '/realtime?' + queryParams;

Expand Down
7 changes: 6 additions & 1 deletion src/services/realtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,12 @@ export class Realtime {
}

// URL carries only the project; channels/queries are sent via the subscribe message.
const queryParams = `project=${projectId}`;
let queryParams = `project=${projectId}`;
Comment thread
greptile-apps[bot] marked this conversation as resolved.

const jwt = this.client.config.jwt;
if (jwt) {
queryParams += `&jwt=${encodeURIComponent(jwt)}`;
}

const endpoint =
this.client.config.endpointRealtime !== ''
Expand Down
4 changes: 2 additions & 2 deletions src/services/usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Usage {
* @param {string} params.resource - Resource type filter (singular form). Common values: function, site, database, bucket, file, webhook, team, user, project.
* @param {string} params.resourceId - Resource id filter.
* @param {string} params.interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
* @param {string[]} params.dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
* @param {string[]} params.dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, resource, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
* @param {string} params.startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
* @param {string} params.endAt - Range end in ISO 8601. Defaults to the current time.
* @param {string} params.orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
Expand All @@ -47,7 +47,7 @@ export class Usage {
* @param {string} resource - Resource type filter (singular form). Common values: function, site, database, bucket, file, webhook, team, user, project.
* @param {string} resourceId - Resource id filter.
* @param {string} interval - Time interval size. Omit (null) for a flat aggregate over the whole window. Allowed: 1m, 15m, 30m, 1h, 1d.
* @param {string[]} dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
* @param {string[]} dimensions - Break-down dimensions (max 10). Allowed: path, method, status, service, resource, country, region, hostname, osName, clientType, clientName, deviceName, teamId, resourceId.
* @param {string} startAt - Range start in ISO 8601. Defaults adapt to interval (7d for the no-interval aggregate).
* @param {string} endAt - Range end in ISO 8601. Defaults to the current time.
* @param {string} orderBy - Column to order by. Allowed: time, value. Default time when an interval is set; otherwise value.
Expand Down