Other
setup()
function setup(): Promise<undefined>;
Wait for encryption processes to be ready (sodium).
getSecrecyClient()
function getSecrecyClient(session?: boolean): SecrecyClient | null;
Get a secrecy client.
Parameters
Parameter | Description | Default |
---|---|---|
session? | If true , the function will retrieve the session in the storage session, otherwise it will retrieve it in the local storage. | undefined |
login()
function login<T extends UseSecrecyParams>({
appCode,
path,
redirect,
scopes,
backPath,
session,
}: T): Promise<Value<T>>;
This function initiates the login process with Secrecy authentication.
Parameters
Parameter | Description | Type | Default |
---|
// TODO
publicKey
client.publicKey: string;
Your secrecy public key.
sessionId
client.sessionId: string;
Your current secrecy session ID.
getSponsorshipLink()
client.getSponsorshipLink(arg: { backUrl: string }): Promise<string | null>;
Returns a link to sponsor a user.
If an user use this link, the creator of the link will receive a bonus. TODO: Preciser le montant du bonus
Parameters
Parameter | Description |
---|---|
backUrl | TODO |
limits()
client.limits(): Promise<AppLimits>;
Get the limits and the current usage of the account for the logged application.
See: AppLimits
logout()
client.logout(sessionId?: string | null): Promise<undefined>;
Disconnects the user from the application. You can specify the session to logout from by passing a
sessionId
parameter.
Parameters
Parameter | Description |
---|---|
sessionId | The session id |
me()
client.me(): Promise<SelfUser>;
Get the user information.
See: SelfUser
reportUser()
client.reportUser(userId: string, reason: string): Promise<{
userId: string;
id: string;
customMessage: string | null;
reportedUserId: string;
}>;
Report a user to the Secrecy team.
Parameters
Parameter | Description |
---|---|
userId | The user ID |
reason | The report reason |
searchUsers()
client.searchUsers(search: string): Promise<PublicUser[]>;
Search for many users by phone, email, firstname or lastname.
Parameters
Parameter | Description |
---|---|
search | The search term |
See: PublicUser
updateProfile()
client.updateProfile(arg: {
firstname: string;
lastname: string;
lang: Lang,
}): Promise<SelfUser>;
Update the user profile.
user()
client.user(arg: { userId: string }): Promise<PublicUser>;
Get a public user information by ID.
Parameters
Parameter | Description |
---|---|
userId | The user ID |
See: PublicUser