appwrite/docs/examples/1.5.x/console-web/examples/projects/create-key.md

17 lines
421 B
Markdown
Raw Normal View History

2024-02-21 11:31:50 +00:00
import { Client, Projects } from "@appwrite.io/console";
2024-02-05 12:40:51 +00:00
2024-02-21 11:31:50 +00:00
const client = new Client()
2025-04-22 13:02:33 +00:00
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
2024-02-05 12:40:51 +00:00
const projects = new Projects(client);
2024-02-21 11:31:50 +00:00
const result = await projects.createKey(
2024-02-24 11:34:42 +00:00
'<PROJECT_ID>', // projectId
'<NAME>', // name
2024-02-21 11:31:50 +00:00
[], // scopes
'' // expire (optional)
);
2024-02-05 12:40:51 +00:00
2025-04-22 13:02:33 +00:00
console.log(result);