@logto/capacitor
v4.1.2
Published
[](https://www.npmjs.com/package/@logto/capacitor) [](https://github.com/logto-io/js/actions/workflows/main.yml) [
Readme
Logto JS Capacitor SDK
The Logto JavaScript Capacitor SDK written in TypeScript.
Installation
Using npm
npm install @logto/capacitor @capacitor/app @capacitor/browser @capacitor/preferencesUsing yarn
yarn add @logto/capacitor @capacitor/app @capacitor/browser @capacitor/preferencesUsing pnpm
pnpm add @logto/capacitor @capacitor/app @capacitor/browser @capacitor/preferencesWhat is this and how does it work?
See Integrate Logto in your application for more information.
OIDC discovery caching is disabled by default. Enable it through the Capacitor options:
const client = new LogtoClient(config, { enableCache: true });Sign-in accepts the same object-form options as @logto/browser, including prompt,
loginHint, and extraParams:
import { Prompt } from '@logto/capacitor';
await client.signIn({
redirectUri: 'io.logto.example://callback',
postRedirectUri: '/home',
prompt: Prompt.Consent,
extraParams: { organization_id: 'organization-id' },
});postRedirectUri must be an in-app URL that the current WebView can load, such as /home. After
sign-in, the SDK navigates the WebView to that URL with a full page reload. External URLs leave the
app shell, and custom-scheme URLs are not supported for this option.
