@descope/vue-sdk
Advanced tools
Comparing version 0.0.0-next-d547dc0a-20230808 to 0.0.0-next-d7dcfa5a-20240205
{ | ||
"name": "@descope/vue-sdk", | ||
"version": "0.0.0-next-d547dc0a-20230808", | ||
"version": "0.0.0-next-d7dcfa5a-20240205", | ||
"main": "dist/index.cjs", | ||
@@ -9,4 +9,10 @@ "module": "dist/index.mjs", | ||
"exports": { | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.mjs" | ||
"require": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.cjs" | ||
}, | ||
"import": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.mjs" | ||
} | ||
}, | ||
@@ -35,3 +41,4 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@descope/web-component": "2.7.1" | ||
"@descope/user-management-widget": "0.0.7", | ||
"@descope/web-component": "3.7.6" | ||
}, | ||
@@ -38,0 +45,0 @@ "peerDependencies": { |
@@ -43,16 +43,13 @@ # Descope Vue SDK | ||
<template> | ||
<Descope | ||
:flowId.prop="'my-flow-id'" | ||
@error="handleError" | ||
@success="handleSuccess" | ||
/> | ||
<Descope flowId="my-flow-id" @error="handleError" @success="handleSuccess" /> | ||
<!-- additional props --> | ||
<!-- :theme.prop="'dark'" theme can be "light", "dark" or "os", which auto select a theme based on the OS theme. Default is "light" --> | ||
<!-- :debug.prop="true" debug can be set to true to enable debug mode --> | ||
<!-- :locale.prop="'en'" locale can be any supported locale which the flow's screen translated to, if not provided, the locale is taken from the browser's locale. --> | ||
<!-- :debug.prop="true" debug can be set to true to enable debug mode --> | ||
<!-- :tenant.prop="tenantId" tenant ID for SSO (SAML) login. If not provided, Descope will use the domain of available email to choose the tenant --> | ||
<!-- :redirectUrl.prop="redirectUrl" Redirect URL for OAuth and SSO (will be used when redirecting back from the OAuth provider / IdP), or for "Magic Link" and "Enchanted Link" (will be used as a link in the message sent to the the user) --> | ||
<!-- :autoFocus.prop="'skipFirstScreen'" autoFocus can be true, false or "skipFirstScreen". Default is true. - true: automatically focus on the first input of each screen - false: do not automatically focus on screen's inputs - "skipFirstScreen": automatically focus on the first input of each screen, except first screen --> | ||
<!-- :errorTransformer.prop="errorTransformer" errorTransformer is a function that receives an error object and returns a string. The returned string will be displayed to the user. NOTE: errorTransformer is not required. If not provided, the error object will be displayed as is. --> | ||
<!-- theme="dark" theme can be "light", "dark" or "os", which auto select a theme based on the OS theme. Default is "light" --> | ||
<!-- v-bind:debug="true" debug can be set to true to enable debug mode --> | ||
<!-- locale="en" locale can be any supported locale which the flow's screen translated to, if not provided, the locale is taken from the browser's locale. --> | ||
<!-- tenant="tenantId" tenant ID for SSO (SAML) login. If not provided, Descope will use the domain of available email to choose the tenant --> | ||
<!-- redirectUrl="redirectUrl" Redirect URL for OAuth and SSO (will be used when redirecting back from the OAuth provider / IdP), or for "Magic Link" and "Enchanted Link" (will be used as a link in the message sent to the the user) --> | ||
<!-- autoFocus="skipFirstScreen" autoFocus can be true, false or "skipFirstScreen". Default is true. - true: automatically focus on the first input of each screen - false: do not automatically focus on screen's inputs - "skipFirstScreen": automatically focus on the first input of each screen, except first screen --> | ||
<!-- errorTransformer="errorTransformer" errorTransformer is a function that receives an error object and returns a string. The returned string will be displayed to the user. NOTE: errorTransformer is not required. If not provided, the error object will be displayed as is. --> | ||
<!-- form="{ email: 'test@domain.com' }" form is an object the initial form context that is used in screens inputs in the flow execution. Used to inject predifined input values on flow start such as custom inputs, custom attrbiutes and other inputs. Keys passed can be accessed in flows actions, conditions and screens prefixed with "form.". NOTE: form is not required. If not provided, 'form' context key will be empty before user input. --> | ||
<!-- client="{ version: '1.2.3' }" client is an object the initial client context in the flow execution. Keys passed can be accessed in flows actions and conditions prefixed with "client.". NOTE: client is not required. If not provided, context key will be empty. --> | ||
</template> | ||
@@ -104,3 +101,3 @@ | ||
<script setup> | ||
import { useDescope, useSession, useUser } from '../../src'; | ||
import { useDescope, useSession, useUser } from '@descope/vue-sdk'; | ||
@@ -262,2 +259,21 @@ const { isAuthenticated, isSessionLoading } = useSession(); | ||
## Q & A | ||
### I updated the user in my backend, but the user / session token are not updated in the frontend | ||
// adjust the answer to vue sdk | ||
The Descope SDK caches the user and session token in the frontend. If you update the user in your backend (using Descope Management SDK/API for example), you can call `me` / `refresh` from `useDescope` hook to refresh the user and session token. Example: | ||
```js | ||
const sdk = useDescope(); | ||
const handleUpdateUser = () => { | ||
myBackendUpdateUser().then(() => { | ||
sdk.me(); | ||
// or | ||
sdk.refresh(); | ||
}); | ||
}; | ||
``` | ||
## Learn More | ||
@@ -264,0 +280,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
168952
2998
287
4
+ Added@descope/core-js-sdk@2.9.02.9.1(transitive)
+ Added@descope/user-management-widget@0.0.7(transitive)
+ Added@descope/web-component@3.7.6(transitive)
+ Added@descope/web-js-sdk@1.9.41.9.5(transitive)
+ Added@fingerprintjs/fingerprintjs-pro@3.8.5(transitive)
+ Added@reduxjs/toolkit@2.4.0(transitive)
+ Addedimmer@10.1.1(transitive)
+ Addedredux@5.0.1(transitive)
+ Addedredux-thunk@3.1.0(transitive)
+ Addedreselect@5.0.15.1.1(transitive)
+ Addedtslib@2.6.2(transitive)
- Removed@descope/core-js-sdk@1.5.0(transitive)
- Removed@descope/web-component@2.7.1(transitive)
- Removed@descope/web-js-sdk@1.3.8(transitive)
- Removed@fingerprintjs/fingerprintjs-pro@3.8.3(transitive)
- Removedtslib@2.6.0(transitive)
Updated@descope/web-component@3.7.6