Skip to main content
Gatekeeper lets your app ask a user for access to an external account, such as Google Drive, and then use only the access that user approved.

Prerequisites

You can find your API key and project name in the Celesto Dashboard.
Set the following environment variables:
  • CELESTO_API_KEY: Your Celesto API key
  • CELESTO_PROJECT_NAME: Your project name
Install the TypeScript SDK:
The TypeScript SDK includes a Gatekeeper client. Python Gatekeeper examples are being updated to the new resource-style SDK.

Quickstart script

Use this complete script to start a connection, list active connections, and list Drive files once OAuth completes.
gatekeeper.ts
Run it:

Expected responses

connect (redirect)
connect (connected)
listConnections
listDriveFiles

How the flow works

1

Create a connection

Call connect with a subject and project name. If the subject has not authorized yet, you receive an OAuth URL.
You get status: redirect and an oauthUrl.
2

Complete OAuth

Send your user to the OAuth URL so they can approve access. The provider calls Celesto back to finalize the connection.
The connection becomes active for that subject.
3

Use delegated access

List connections, fetch file metadata, update access rules, or revoke access when you are done.

SDK methods

connect

string
required
Stable identifier for your end user, for example user:acme:alice.
string
required
Your Celesto project name.
string
default:"google_drive"
Provider key. Use google_drive for Google Drive.
string
Optional custom redirect URI after OAuth completion.

listConnections

listDriveFiles

updateAccessRules

Use access rules to limit which folders or files the connection can read.

revokeConnection

Use this when the user disconnects their account or your app no longer needs access.
Last modified on July 4, 2026