mirror of
https://github.com/appwrite/sdk-for-dart.git
synced 2026-04-07 19:17:49 +00:00
5bc810f5d8
* Breaking: Renamed `IndexType` to `DatabasesIndexType` * Breaking: Replaced `setKey()` with `setSession()` for authentication * Updated: Docs reflect API changes and new auth method
1.2 KiB
1.2 KiB
import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart' as enums;
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
Functions functions = Functions(client);
Func result = await functions.create(
functionId: '<FUNCTION_ID>',
name: '<NAME>',
runtime: enums.Runtime.node145,
execute: ["any"], // (optional)
events: [], // (optional)
schedule: '', // (optional)
timeout: 1, // (optional)
enabled: false, // (optional)
logging: false, // (optional)
entrypoint: '<ENTRYPOINT>', // (optional)
commands: '<COMMANDS>', // (optional)
scopes: [enums.Scopes.sessionsWrite], // (optional)
installationId: '<INSTALLATION_ID>', // (optional)
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional)
providerBranch: '<PROVIDER_BRANCH>', // (optional)
providerSilentMode: false, // (optional)
providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // (optional)
buildSpecification: '', // (optional)
runtimeSpecification: '', // (optional)
deploymentRetention: 0, // (optional)
);