Skip to content
Esc
navigateopen⌘Jpreview
Dashboard
On this page

@supertokens-plugins/profile-base-react

Public root exports for @supertokens-plugins/profile-base-react 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
default Constant
init Constant
PLUGIN_ID Constant
PLUGIN_VERSION Constant
usePluginContext Constant
UserProfileWrapper Constant

default

Published from the emitted _default declaration.

Root export:

export default _default;

Resolved declaration:

declare const _default: {
    init: (config?: (import('./types').SuperTokensPluginProfileConfig & {
        override?: ((oI: undefined) => undefined) | undefined;
    }) | undefined) => import('supertokens-auth-react').SuperTokensPlugin;
    PLUGIN_ID: string;
    UserProfileWrapper: () => import("react/jsx-runtime").JSX.Element;
    usePluginContext: () => {
        pluginConfig: import('./types').SuperTokensPluginProfileConfig;
        getSections: () => import('./types').SuperTokensPluginProfileSection[];
        registerSection: import('./types').RegisterSection;
        getOnLoadHandlers: () => (() => Promise<void>)[];
        t: (key: import('./types').TranslationKeys, replacements?: Record<string, string>) => string;
    };
};

init

Root export:

import { init, usePluginContext } from './plugin';
import { PLUGIN_ID, PLUGIN_VERSION } from './constants';
import { UserProfileWrapper } from './user-profile-wrapper';
export { init, PLUGIN_ID, PLUGIN_VERSION, UserProfileWrapper, usePluginContext };

Resolved declaration:

import { RegisterSection, SuperTokensPluginProfileConfig, SuperTokensPluginProfileSection, TranslationKeys } from './types';
import { SuperTokensPlugin } from 'supertokens-auth-react';
export declare const init: (config?: (SuperTokensPluginProfileConfig & {
    override?: ((oI: undefined) => undefined) | undefined;
}) | undefined) => SuperTokensPlugin;

PLUGIN_ID

Root export:

import { init, usePluginContext } from './plugin';
import { PLUGIN_ID, PLUGIN_VERSION } from './constants';
import { UserProfileWrapper } from './user-profile-wrapper';
export { init, PLUGIN_ID, PLUGIN_VERSION, UserProfileWrapper, usePluginContext };

Resolved declaration:

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

PLUGIN_VERSION

Root export:

import { init, usePluginContext } from './plugin';
import { PLUGIN_ID, PLUGIN_VERSION } from './constants';
import { UserProfileWrapper } from './user-profile-wrapper';
export { init, PLUGIN_ID, PLUGIN_VERSION, UserProfileWrapper, usePluginContext };

Resolved declaration:

export declare const PLUGIN_VERSION = "0.0.1";

usePluginContext

Root export:

import { init, usePluginContext } from './plugin';
import { PLUGIN_ID, PLUGIN_VERSION } from './constants';
import { UserProfileWrapper } from './user-profile-wrapper';
export { init, PLUGIN_ID, PLUGIN_VERSION, UserProfileWrapper, usePluginContext };

Resolved declaration:

import { RegisterSection, SuperTokensPluginProfileConfig, SuperTokensPluginProfileSection, TranslationKeys } from './types';
declare const usePluginContext: () => {
    pluginConfig: SuperTokensPluginProfileConfig;
    getSections: () => SuperTokensPluginProfileSection[];
    registerSection: RegisterSection;
    getOnLoadHandlers: () => (() => Promise<void>)[];
    t: (key: TranslationKeys, replacements?: Record<string, string>) => string;
};

UserProfileWrapper

Root export:

import { init, usePluginContext } from './plugin';
import { PLUGIN_ID, PLUGIN_VERSION } from './constants';
import { UserProfileWrapper } from './user-profile-wrapper';
export { init, PLUGIN_ID, PLUGIN_VERSION, UserProfileWrapper, usePluginContext };

Resolved declaration:

export declare const UserProfileWrapper: () => import("react/jsx-runtime").JSX.Element;

Required signature types

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

defaultTranslations

export declare const defaultTranslations: {
    readonly en: {
        readonly PL_PB_USER_PROFILE: "User Profile";
    };
};

RegisterSection

export type RegisterSection = (sectionBuilder: () => Promise<Section | Section[]>) => void;

Section

export type Section = Omit<SuperTokensPluginProfileSection, "order"> & {
    order?: number;
};

SuperTokensPluginProfileConfig

export type SuperTokensPluginProfileConfig = {
    profilePagePath?: string;
    sections?: SuperTokensPluginProfileSection[];
};

SuperTokensPluginProfileSection

import { default as React } from 'react';
export type SuperTokensPluginProfileSection = {
    id: string;
    title: string;
    order: number;
    icon?: () => React.JSX.Element;
    component: () => React.JSX.Element;
};

TranslationKeys

import { defaultTranslations } from './translations';
export type TranslationKeys = keyof (typeof defaultTranslations)["en"];

API reference

API schema and response details