Other

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

ParameterDescriptionDefault
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

ParameterDescriptionTypeDefault

// 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>;
🔒
Auth: Secrecy

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

ParameterDescription
backUrlTODO

limits()

client.limits(): Promise<AppLimits>;
🔒
Auth: Secrecy

Get the limits and the current usage of the account for the logged application.

See: AppLimits


logout()

client.logout(sessionId?: string | null): Promise<undefined>;
🔒
Auth: Secrecy

Disconnects the user from the application. You can specify the session to logout from by passing a sessionId parameter.

Parameters

ParameterDescription
sessionIdThe session id

me()

client.me(): Promise<SelfUser>;
🔒
Auth: Secrecy

Get the user information.

See: SelfUser


reportUser()

client.reportUser(userId: string, reason: string): Promise<{
  userId: string;
  id: string;
  customMessage: string | null;
  reportedUserId: string;
}>;
🔒
Auth: Secrecy

Report a user to the Secrecy team.

Parameters

ParameterDescription
userIdThe user ID
reasonThe report reason

searchUsers()

client.searchUsers(search: string): Promise<PublicUser[]>;
🔒
Auth: Secrecy

Search for many users by phone, email, firstname or lastname.

Parameters

ParameterDescription
searchThe search term

See: PublicUser


updateProfile()

client.updateProfile(arg: {
  firstname: string;
  lastname: string;
  lang: Lang,
}): Promise<SelfUser>;
🔒
Auth: Secrecy

Update the user profile.

See: Lang, SelfUser


user()

client.user(arg: { userId: string }): Promise<PublicUser>;

Get a public user information by ID.

Parameters

ParameterDescription
userIdThe user ID

See: PublicUser