Skip to content
Esc
navigateopen⌘Jpreview
Dashboard
On this page

@supertokens-plugins/profile-details-nodejs

Public root exports for @supertokens-plugins/profile-details-nodejs 0.1.0.

Package version: 0.1.0

Plugin protocol version (PLUGIN_VERSION): 0.0.1

The protocol version is an internal plugin compatibility constant. It is not the npm package version.

Generated from the packed release’s root declaration, ./dist/index.d.ts. Only exports reachable from that root are listed. See the immutable release source.

Public root exports

Export Kind
BaseFormSection Export
default Constant
getProfile Constant
getSections Constant
init Constant
PLUGIN_ID Constant
PLUGIN_VERSION Constant
updateProfile Constant

BaseFormSection

Published from the emitted unknown declaration.

Root export:

import { BaseFormFieldPayload, BaseFormSection } from '@supertokens-plugins/profile-details-shared';
export type { BaseFormSection };

default

Published from the emitted _default declaration.

Root export:

export default _default;

Resolved declaration:

import { BaseFormFieldPayload, BaseFormSection } from '@supertokens-plugins/profile-details-shared';
import { Implementation } from './implementation';
import { SessionContainerInterface } from 'supertokens-node/recipe/session/types';
declare const _default: {
    init: (config?: ({
        sections?: BaseFormSection[];
        registerSectionsForProgressiveProfiling?: boolean;
    } & {
        override?: ((oI: import('@shared/js').OverridableFunctions<Implementation>) => import('@shared/js').OverridableFunctions<Implementation>) | undefined;
    }) | undefined) => import('supertokens-node').SuperTokensPlugin;
    PLUGIN_ID: string;
    PLUGIN_VERSION: string;
    getProfile: (userId: string, session: SessionContainerInterface, userContext?: Record<string, any>) => Promise<import('@supertokens-plugins/profile-details-shared').BaseProfile>;
    updateProfile: (userId: string, profile: BaseFormFieldPayload[], session: SessionContainerInterface, userContext?: Record<string, any>) => Promise<void>;
    getSections: (session: SessionContainerInterface, userContext?: Record<string, any>) => BaseFormSection[];
};

getProfile

Root export:

import { SessionContainerInterface } from 'supertokens-node/recipe/session/types';
export declare const getProfile: (userId: string, session: SessionContainerInterface, userContext?: Record<string, any>) => Promise<import('@supertokens-plugins/profile-details-shared').BaseProfile>;

getSections

Root export:

import { SessionContainerInterface } from 'supertokens-node/recipe/session/types';
import { BaseFormFieldPayload, BaseFormSection } from '@supertokens-plugins/profile-details-shared';
export declare const getSections: (session: SessionContainerInterface, userContext?: Record<string, any>) => BaseFormSection[];

init

Root export:

import { init } from './plugin';
import { PLUGIN_ID, PLUGIN_VERSION } from './constants';
export { init, PLUGIN_ID, PLUGIN_VERSION };

Resolved declaration:

import { Implementation } from './implementation';
import { SuperTokensPlugin } from 'supertokens-node/types';
export declare const init: (config?: ({
    sections?: import('@supertokens-plugins/profile-details-shared').BaseFormSection[];
    registerSectionsForProgressiveProfiling?: boolean;
} & {
    override?: ((oI: import('@shared/js').OverridableFunctions<Implementation>) => import('@shared/js').OverridableFunctions<Implementation>) | undefined;
}) | undefined) => SuperTokensPlugin;

PLUGIN_ID

Root export:

import { init } from './plugin';
import { PLUGIN_ID, PLUGIN_VERSION } from './constants';
export { init, PLUGIN_ID, PLUGIN_VERSION };

Resolved declaration:

export declare const PLUGIN_ID = "supertokens-plugin-profile-details";

PLUGIN_VERSION

Root export:

import { init } from './plugin';
import { PLUGIN_ID, PLUGIN_VERSION } from './constants';
export { init, PLUGIN_ID, PLUGIN_VERSION };

Resolved declaration:

export declare const PLUGIN_VERSION = "0.0.1";

updateProfile

Root export:

import { BaseFormFieldPayload, BaseFormSection } from '@supertokens-plugins/profile-details-shared';
import { SessionContainerInterface } from 'supertokens-node/recipe/session/types';
export declare const updateProfile: (userId: string, profile: BaseFormFieldPayload[], session: SessionContainerInterface, userContext?: Record<string, any>) => Promise<void>;

Required signature types

These declarations are not additional package-root exports. They are included because the public signatures above depend on them.

Implementation

import { BaseFormField, BaseFormFieldPayload, BaseProfile, BaseFormSection } from '@supertokens-plugins/profile-details-shared';
import { SuperTokensPluginProfileDetailsNormalisedConfig } from './types';
import { SessionContainerInterface } from 'supertokens-node/recipe/session/types';
import { FormFieldValue } from '@shared/ui';
export declare class Implementation {
    static instance: Implementation | undefined;
    protected sections: BaseFormSection[];
    static init(pluginConfig: SuperTokensPluginProfileDetailsNormalisedConfig): Implementation;
    static getInstanceOrThrow(): Implementation;
    static reset(): void;
    constructor(pluginConfig: SuperTokensPluginProfileDetailsNormalisedConfig);
    defaultStorageHandlerGet: (this: Implementation, userId: string, session: SessionContainerInterface, userContext?: Record<string, any>) => Promise<{
        profile: Record<string, FormFieldValue>;
    }>;
    defaultStorageHandlerSet: (this: Implementation, userId: string, payload: {
        profile: Record<string, FormFieldValue>;
    }, session: SessionContainerInterface, userContext?: Record<string, any>) => Promise<void>;
    getPluginFormFields: (this: Implementation, session: SessionContainerInterface, userContext?: Record<string, any>) => (BaseFormField & {
        sectionId: string;
    })[];
    getFieldValueFromThirdPartyUserInfo: (this: Implementation, providerId: string, field: BaseFormField & {
        sectionId: string;
    }, rawUserInfoFromProvider: any, profile: BaseProfile) => BaseProfile[string];
    getProfile: (this: Implementation, userId: string, session: SessionContainerInterface, userContext?: Record<string, any>) => Promise<BaseProfile>;
    updateProfile: (this: Implementation, userId: string, payload: BaseFormFieldPayload[], session: SessionContainerInterface, userContext?: Record<string, any>) => Promise<void>;
    buildProfile: (this: Implementation, formData: BaseFormFieldPayload[], existingProfile: BaseProfile, session: SessionContainerInterface, userContext?: Record<string, any>) => BaseProfile;
    buildFormData: (this: Implementation, profile: BaseProfile, session: SessionContainerInterface, userContext?: Record<string, any>) => BaseFormFieldPayload[];
    getSections: (this: Implementation, session: SessionContainerInterface, userContext?: Record<string, any>) => BaseFormSection[];
}

SuperTokensPluginProfileDetailsNormalisedConfig

import { BaseFormField, BaseFormSection, BaseProfile } from '@supertokens-plugins/profile-details-shared';
export type SuperTokensPluginProfileDetailsNormalisedConfig = {
    sections: BaseFormSection[];
    registerSectionsForProgressiveProfiling: boolean;
};

API reference

API schema and response details