From eabde95a32007267201ddb485a2c96a20df9767c Mon Sep 17 00:00:00 2001 From: Zai Shi Date: Fri, 8 Nov 2024 14:05:08 +0100 Subject: [PATCH] Added callbackUrl to server user invitation (#331) --- docs/fern/docs/pages/sdk/team.mdx | 8 ++++++++ packages/stack/src/lib/stack-app.ts | 19 +++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/fern/docs/pages/sdk/team.mdx b/docs/fern/docs/pages/sdk/team.mdx index 500f04502..e56606b5f 100644 --- a/docs/fern/docs/pages/sdk/team.mdx +++ b/docs/fern/docs/pages/sdk/team.mdx @@ -108,6 +108,14 @@ An invitation email containing a magic link will be sent to the specified user. The email of the user to invite. + + + The URL where users will be redirected after accepting the team invitation. + + Required when calling `inviteUser()` in the server environment since the URL cannot be automatically determined. + + Example: `https://your-app-url.com/handler/team-invitation` + diff --git a/packages/stack/src/lib/stack-app.ts b/packages/stack/src/lib/stack-app.ts index 7fe863176..31a60bb66 100644 --- a/packages/stack/src/lib/stack-app.ts +++ b/packages/stack/src/lib/stack-app.ts @@ -753,12 +753,15 @@ class _StackClientAppImpl, + inviteUser(options: { email: string, callbackUrl?: string }): Promise, listUsers(): Promise, useUsers(): TeamUser[], update(update: TeamUpdateOptions): Promise, @@ -3092,7 +3099,7 @@ export type ServerTeam = { update(update: ServerTeamUpdateOptions): Promise, delete(): Promise, addUser(userId: string): Promise, - inviteUser(options: { email: string }): Promise, + inviteUser(options: { email: string, callbackUrl?: string }): Promise, removeUser(userId: string): Promise, } & Team;