@veltdev/sdk
Version:
Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.
112 lines (111 loc) • 2.97 kB
TypeScript
import { UserContact } from "./user-contact.data.model";
export declare class User {
/**
* Unique user identifier that you use to identify your user.
*/
userId: string;
/**
* Your user's full name.
*
* Default: Random avatar name.
*/
name?: string;
clientUserName?: string;
/**
* Your user's display picture URL.
*
* Default: Random avatar image.
*/
photoUrl?: string;
/**
* This is required if you want us to send email or slack notifications
* to users when they add comments and tag their co-workers.
*/
email?: string;
/**
* This will help us show a drop down when a user wants to tag their co-workers in a comment.
*/
contacts?: UserContact[];
/**
* The product plan your user is on.
*/
plan?: string;
/**
* It could be a domain name or any identifier you use to cluster a group of users who work together.
*/
groupId?: string;
/**
* Original groupId provided by the user.
*/
clientGroupId?: string;
organizationId?: string;
clientOrganizationId?: string;
/**
* Auto generated unique user id that is linked with your app's user ID.
* This is needed by us for internal processing.
*/
userSnippylyId?: string;
/**
* A random color is assigned to the user for the current session.
* This is the color on the avatar border and live cursor, if these features are enabled.
*/
color?: string;
/**
* This is the color on the avatar text.
*/
textColor?: string;
/**
* User type.
*
*/
type?: string;
isAdmin?: boolean;
/**
* Readonly user
*/
isReadOnly?: boolean;
/**
* Anonymous user can only view the comments
*/
isAnonymous?: boolean;
/**
* Guest user
*/
isGuest?: boolean;
initial?: string;
}
export declare class Options {
/**
* If you want to replace the contacts of the user with the contacts you are sending.
* This will replace personal and group contacts of the user.
*/
replaceContacts?: boolean;
/**
* If you want to replace the personal contacts of the user with the contacts you are sending.
* This will replace personal contacts of the user.
*/
replacePrivateContacts?: boolean;
/**
* If you want to replace the group contacts of the user with the contacts you are sending.
* This will replace group contacts of the user.
*/
replaceGroupContacts?: boolean;
/**
* Pass the auth token of the user.
*/
authToken?: string;
/**
* If you want to force re-login the user.
*/
forceReset?: boolean;
}
export interface AuthRetryConfig {
retryCount?: number;
retryDelay?: number;
}
export interface VeltAuthProvider {
user: User;
options?: Options;
retryConfig?: AuthRetryConfig;
generateToken?: () => Promise<string>;
}