Skip to content

Commit b4ef615

Browse files
committed
feat: adds inviteUserByEmail for api users
1 parent 0de76d6 commit b4ef615

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/core/auth-js/src/GoTrueApi.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ export default class GoTrueApi {
7171
}
7272
}
7373

74+
/**
75+
* Sends an invite link to an email address.
76+
* @param email The email address of the user.
77+
*/
78+
async inviteUserByEmail(email: string): Promise<{ data: {} | null; error: Error | null }> {
79+
try {
80+
const data = await post(`${this.url}/invite`, { email }, { headers: this.headers })
81+
return { data, error: null }
82+
} catch (error) {
83+
return { data: null, error }
84+
}
85+
}
86+
7487
/**
7588
* Sends a reset request to an email address.
7689
* @param email The email address of the user.

0 commit comments

Comments
 (0)