In our application, we have multiple number of users, and for each user, we’ve created a virtual account and a virtual calendar under a single Nylas account.
Each user should be able to:
Manage their own availability schedule using the Scheduler Editor UI
Share a unique booking page (Scheduler Page UI)
However, we’re facing a blocker:
The Scheduler Editor UI requires a user-specific access token, but there’s no clear way to generate this token without going through the OAuth flow.
Our users are internal app users — not calendar account owners — so OAuth is not a valid option.
The NylasSessionConfig setup requires a real Google or Microsoft connection, which doesn’t apply in our case.
How can we provide the Scheduler Editor UI to virtual users who don’t authenticate via OAuth?
We’d appreciate guidance on how to securely generate and pass access tokens for virtual users in this use case.
Welcome to the Nylas Community! For your scenario with internal users (not Google/Microsoft account owners) and virtual calendars, you should use Nylas Virtual Accounts with Custom Authentication, not OAuth.
Here’s how you can enable the Scheduler Editor UI for these virtual users:
Create a Virtual Account (grant) for each user
Use the Custom Authentication endpoint to create a grant for each internal user, specifying provider: "virtual-calendar" and a unique email (serves as the virtual account ID)
After creating the grant, use the same Custom Auth flow to generate an access token for each virtual user. No OAuth is required—just the API key and the virtual account identifier.
Integrate Scheduler Editor UI with Custom Auth
Use the Scheduler Editor UI’s nylasApiRequest property with a custom request wrapper that injects the virtual user’s access token. The documentation provides an example for this exact use case:
export class CustomIdentityRequestWrapper {
private accessToken: string;
constructor(accessToken: string) {
this.accessToken = accessToken;
}
async request<T = any>(args: any): Promise<T> {
// ...fetch logic using this.accessToken...
}
async currentUser() {
// return info for the virtual user
return { id: 'idToken.sub', email: 'j.doe@example.com', name: 'John Doe', provider: 'google' };
}
// ...other methods...
}
Then, in your UI code:
javascript
const nylasApiRequest = new CustomIdentityRequestWrapper('<NYLAS_ACCESS_TOKEN>', domain);
schedulerEditor.nylasApiRequest = nylasApiRequest;
This lets you present the Scheduler Editor UI for each virtual user using their specific access token—no OAuth needed.
Summary:
Use Custom Auth to create virtual accounts and generate access tokens for each user.
Pass each user’s access token into the Scheduler Editor UI using a custom wrapper.
No Google/Microsoft OAuth is required for virtual accounts.