diff --git a/.prettierignore b/.prettierignore index 4993d43..6a55445 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,3 +5,4 @@ node_modules README.md src/**/*.min.css .github/ISSUE_TEMPLATE/*.md +packages/sdk-vue/web-types.json \ No newline at end of file diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 5f1379b..0dcd81f 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,5 +1,5 @@ export * from './SDKCore'; export * from './SDKConfig'; -export * from './SDKContext'; +export { type SDKContext } from './SDKContext'; export * from './testUtils'; export { type CookieAdapter } from './CookieHelpers'; diff --git a/packages/sdk-vue/CHANGES.md b/packages/sdk-vue/CHANGES.md index eaf1d9f..9d50ea8 100644 --- a/packages/sdk-vue/CHANGES.md +++ b/packages/sdk-vue/CHANGES.md @@ -1,7 +1,20 @@ fusionauth-vue-sdk Changes -Upcoming release +Changes in 1.2.0 +- [`postLogoutRedirectUri`](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/main/packages/sdk-vue/docs/interfaces/types.FusionAuthConfig.md#postlogoutredirecturi) config option added. +- [`createFusionAuth`](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/main/packages/sdk-vue/docs/modules.md#createfusionauth) factory function is now an exported member of the package. This was suggested in issue [#104](https://github.com/FusionAuth/fusionauth-javascript-sdk/issues/104) and provides more flexibility in setting up your fusionauth plugin. +- `manageAccount` function and button added. [Self service account management](https://fusionauth.io/docs/lifecycle/manage-users/account-management/) is only available in FusionAuth paid plans. +- `userInfo` can now be custom typed with an optional generic argument. This may be helpful for SDK users with a non-hosted backend. Below is an example of what it may look like. + ```typescript + interface MyUser { + customTrait: string; + // ... + } + const { userInfo } = useFusionAuth(); + // where `userInfo.value` is inferred to be of type `Ref` + ``` +- Missing optional properties added to `UserInfo` type definition. - sourcemaps included for debugging Changes in 1.1.0 diff --git a/packages/sdk-vue/README.md b/packages/sdk-vue/README.md index 58c7d6c..2fca434 100644 --- a/packages/sdk-vue/README.md +++ b/packages/sdk-vue/README.md @@ -121,6 +121,28 @@ export default defineNuxtPlugin((nuxtApp) => { }); ``` +##### Alternate ways to define your nuxt plugin + +Using `createFusionAuth`, the SDK can be configured more flexibly. + +```typescript +export default defineNuxtPlugin({ + setup(nuxtApp) { + const fusionauth = createFusionAuth(config); + nuxtApp.vueApp.use(FusionAuthVuePlugin, { instance: fusionauth }) + return { + provide: { fusionauth } + }; + }, + hooks: { + "app:beforeMount"() { + const { $fusionauth } = useNuxtApp(); + // ... + }, + } +}) +``` + ### `useFusionAuth` composable You can interact with the SDK by using the `useFusionAuth`, which leverages [Vue's Composition API](https://vuejs.org/guide/reusability/composables). diff --git a/packages/sdk-vue/docs/README.md b/packages/sdk-vue/docs/README.md index 781012f..b1fe7ea 100644 --- a/packages/sdk-vue/docs/README.md +++ b/packages/sdk-vue/docs/README.md @@ -1,4 +1,4 @@ -@fusionauth/vue-sdk / [Modules](modules.md) +@fusionauth/vue-sdk / [Exports](modules.md) An SDK for using FusionAuth in Vue applications. @@ -123,6 +123,28 @@ export default defineNuxtPlugin((nuxtApp) => { }); ``` +##### Alternate ways to define your nuxt plugin + +Using `createFusionAuth`, the SDK can be configured more flexibly. + +```typescript +export default defineNuxtPlugin({ + setup(nuxtApp) { + const fusionauth = createFusionAuth(config); + nuxtApp.vueApp.use(FusionAuthVuePlugin, { instance: fusionauth }) + return { + provide: { fusionauth } + }; + }, + hooks: { + "app:beforeMount"() { + const { $fusionauth } = useNuxtApp(); + // ... + }, + } +}) +``` + ### `useFusionAuth` composable You can interact with the SDK by using the `useFusionAuth`, which leverages [Vue's Composition API](https://vuejs.org/guide/reusability/composables). diff --git a/packages/sdk-vue/docs/interfaces/FusionAuth.md b/packages/sdk-vue/docs/interfaces/FusionAuth.md new file mode 100644 index 0000000..e99cbb5 --- /dev/null +++ b/packages/sdk-vue/docs/interfaces/FusionAuth.md @@ -0,0 +1,231 @@ +[@fusionauth/vue-sdk](../README.md) / [Exports](../modules.md) / FusionAuth + +# Interface: FusionAuth\ + +FusionAuth object provided at app-level by FusionAuthVuePlugin + +## Type parameters + +| Name | Type | +| :--- | :------------------------ | +| `T` | [`UserInfo`](UserInfo.md) | + +## Table of contents + +### Properties + +- [error](FusionAuth.md#error) +- [getUserInfo](FusionAuth.md#getuserinfo) +- [initAutoRefresh](FusionAuth.md#initautorefresh) +- [isGettingUserInfo](FusionAuth.md#isgettinguserinfo) +- [isLoggedIn](FusionAuth.md#isloggedin) +- [login](FusionAuth.md#login) +- [logout](FusionAuth.md#logout) +- [manageAccount](FusionAuth.md#manageaccount) +- [refreshToken](FusionAuth.md#refreshtoken) +- [register](FusionAuth.md#register) +- [userInfo](FusionAuth.md#userinfo) + +## Properties + +### error + +• **error**: `Ref`\<`null` \| `Error`\> + +Error occurred within getUserInfo. + +#### Defined in + +[src/types.ts:134](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L134) + +--- + +### getUserInfo + +• **getUserInfo**: () => `Promise`\<`undefined` \| `T`\> + +This is handled automatically if the SDK is configured with `shouldAutoFetchUserInfo`. +Internally updates `isFetchingUser` and `userInfo` refs, as well as `error` if the request fails. + +#### Type declaration + +▸ (): `Promise`\<`undefined` \| `T`\> + +##### Returns + +`Promise`\<`undefined` \| `T`\> + +#### Defined in + +[src/types.ts:119](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L119) + +--- + +### initAutoRefresh + +• **initAutoRefresh**: () => `undefined` \| `Timeout` + +Initializes automatic refreshing of the access token. +Refresh is scheduled to happen at the configured `autoRefreshSecondsBeforeExpiry`. + +#### Type declaration + +▸ (): `undefined` \| `Timeout` + +##### Returns + +`undefined` \| `Timeout` + +#### Defined in + +[src/types.ts:169](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L169) + +--- + +### isGettingUserInfo + +• **isGettingUserInfo**: `Ref`\<`boolean`\> + +Indicates that the getUserInfo call is unresolved. + +#### Defined in + +[src/types.ts:129](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L129) + +--- + +### isLoggedIn + +• **isLoggedIn**: `Ref`\<`boolean`\> + +Whether the user is logged in. + +#### Defined in + +[src/types.ts:112](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L112) + +--- + +### login + +• **login**: (`state?`: `string`) => `void` + +Initiates login flow. + +#### Type declaration + +▸ (`state?`): `void` + +##### Parameters + +| Name | Type | Description | +| :------- | :------- | :--------------------------------------------------------- | +| `state?` | `string` | Optional value to be echoed back to the SDK upon redirect. | + +##### Returns + +`void` + +#### Defined in + +[src/types.ts:140](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L140) + +--- + +### logout + +• **logout**: () => `void` + +Initiates a logout. + +#### Type declaration + +▸ (): `void` + +##### Returns + +`void` + +#### Defined in + +[src/types.ts:151](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L151) + +--- + +### manageAccount + +• **manageAccount**: () => `void` + +Redirects to [self service account management](https://fusionauth.io/docs/lifecycle/manage-users/account-management/) +Self service account management is only available in FusionAuth paid plans. + +#### Type declaration + +▸ (): `void` + +##### Returns + +`void` + +#### Defined in + +[src/types.ts:157](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L157) + +--- + +### refreshToken + +• **refreshToken**: () => `Promise`\<`Response`\> + +Refreshes the access token a single time. +Token refreshing is handled automatically if configured with `shouldAutoRefresh`. + +#### Type declaration + +▸ (): `Promise`\<`Response`\> + +##### Returns + +`Promise`\<`Response`\> + +#### Defined in + +[src/types.ts:163](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L163) + +--- + +### register + +• **register**: (`state?`: `string`) => `void` + +Initiates register flow. + +#### Type declaration + +▸ (`state?`): `void` + +##### Parameters + +| Name | Type | Description | +| :------- | :------- | :--------------------------------------------------------- | +| `state?` | `string` | Optional value to be echoed back to the SDK upon redirect. | + +##### Returns + +`void` + +#### Defined in + +[src/types.ts:146](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L146) + +--- + +### userInfo + +• **userInfo**: `Ref`\<`null` \| `T`\> + +Data fetched from the configured 'me' endpoint. + +#### Defined in + +[src/types.ts:124](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L124) diff --git a/packages/sdk-vue/docs/interfaces/FusionAuthConfig.md b/packages/sdk-vue/docs/interfaces/FusionAuthConfig.md new file mode 100644 index 0000000..4eb8420 --- /dev/null +++ b/packages/sdk-vue/docs/interfaces/FusionAuthConfig.md @@ -0,0 +1,287 @@ +[@fusionauth/vue-sdk](../README.md) / [Exports](../modules.md) / FusionAuthConfig + +# Interface: FusionAuthConfig + +Config for the FusionAuth Vue SDK + +## Table of contents + +### Properties + +- [autoRefreshSecondsBeforeExpiry](FusionAuthConfig.md#autorefreshsecondsbeforeexpiry) +- [clientId](FusionAuthConfig.md#clientid) +- [loginPath](FusionAuthConfig.md#loginpath) +- [logoutPath](FusionAuthConfig.md#logoutpath) +- [mePath](FusionAuthConfig.md#mepath) +- [nuxtUseCookie](FusionAuthConfig.md#nuxtusecookie) +- [onAutoRefreshFailure](FusionAuthConfig.md#onautorefreshfailure) +- [onRedirect](FusionAuthConfig.md#onredirect) +- [postLogoutRedirectUri](FusionAuthConfig.md#postlogoutredirecturi) +- [redirectUri](FusionAuthConfig.md#redirecturi) +- [registerPath](FusionAuthConfig.md#registerpath) +- [scope](FusionAuthConfig.md#scope) +- [serverUrl](FusionAuthConfig.md#serverurl) +- [shouldAutoFetchUserInfo](FusionAuthConfig.md#shouldautofetchuserinfo) +- [shouldAutoRefresh](FusionAuthConfig.md#shouldautorefresh) +- [tokenRefreshPath](FusionAuthConfig.md#tokenrefreshpath) + +## Properties + +### autoRefreshSecondsBeforeExpiry + +• `Optional` **autoRefreshSecondsBeforeExpiry**: `number` + +The number of seconds before the access token expiry when the auto refresh functionality kicks in if enabled. Default is 30. + +#### Defined in + +[src/types.ts:44](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L44) + +--- + +### clientId + +• **clientId**: `string` + +The client id of the application. + +#### Defined in + +[src/types.ts:15](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L15) + +--- + +### loginPath + +• `Optional` **loginPath**: `string` + +The path to the login endpoint. + +#### Defined in + +[src/types.ts:65](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L65) + +--- + +### logoutPath + +• `Optional` **logoutPath**: `string` + +The path to the logout endpoint. + +#### Defined in + +[src/types.ts:69](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L69) + +--- + +### mePath + +• `Optional` **mePath**: `string` + +The path to the me endpoint. + +#### Defined in + +[src/types.ts:81](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L81) + +--- + +### nuxtUseCookie + +• `Optional` **nuxtUseCookie**: \(`name`: `string`, `_opts?`: `CookieOptions`\<`T`\> & \{ `readonly?`: `false` }) => `CookieRef`\<`T`\>\(`name`: `string`, `_opts`: `CookieOptions`\<`T`\> & \{ `readonly`: `true` }) => `Readonly`\<`CookieRef`\<`T`\>\> + +Pass in `useCookie` from nuxt/app [useCookie](https://nuxt.com/docs/api/composables/use-cookie). +This is needed for the Vue SDK to support Nuxt/SSR. + +#### Type declaration + +▸ \<`T`\>(`name`, `_opts?`): `CookieRef`\<`T`\> + +##### Type parameters + +| Name | Type | +| :--- | :-------------------------------- | +| `T` | `undefined` \| `null` \| `string` | + +##### Parameters + +| Name | Type | +| :------- | :------------------------------------------------- | +| `name` | `string` | +| `_opts?` | `CookieOptions`\<`T`\> & \{ `readonly?`: `false` } | + +##### Returns + +`CookieRef`\<`T`\> + +▸ \<`T`\>(`name`, `_opts`): `Readonly`\<`CookieRef`\<`T`\>\> + +##### Type parameters + +| Name | Type | +| :--- | :-------------------------------- | +| `T` | `undefined` \| `null` \| `string` | + +##### Parameters + +| Name | Type | +| :------ | :----------------------------------------------- | +| `name` | `string` | +| `_opts` | `CookieOptions`\<`T`\> & \{ `readonly`: `true` } | + +##### Returns + +`Readonly`\<`CookieRef`\<`T`\>\> + +#### Defined in + +[src/types.ts:60](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L60) + +--- + +### onAutoRefreshFailure + +• `Optional` **onAutoRefreshFailure**: (`error`: `Error`) => `void` + +Callback to be invoked if a request to refresh the access token fails during autorefresh. + +#### Type declaration + +▸ (`error`): `void` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `error` | `Error` | + +##### Returns + +`void` + +#### Defined in + +[src/types.ts:54](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L54) + +--- + +### onRedirect + +• `Optional` **onRedirect**: (`state?`: `string`) => `void` + +Callback function to be invoked with the `state` value upon redirect from login or register. + +#### Type declaration + +▸ (`state?`): `void` + +##### Parameters + +| Name | Type | +| :------- | :------- | +| `state?` | `string` | + +##### Returns + +`void` + +#### Defined in + +[src/types.ts:49](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L49) + +--- + +### postLogoutRedirectUri + +• `Optional` **postLogoutRedirectUri**: `string` + +The redirect URI for post-logout. Defaults the provided `redirectUri`. + +#### Defined in + +[src/types.ts:24](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L24) + +--- + +### redirectUri + +• **redirectUri**: `string` + +The redirect URI of the application. + +#### Defined in + +[src/types.ts:19](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L19) + +--- + +### registerPath + +• `Optional` **registerPath**: `string` + +The path to the register endpoint. + +#### Defined in + +[src/types.ts:73](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L73) + +--- + +### scope + +• `Optional` **scope**: `string` + +The OAuth2 scope parameter passed to the `/oauth2/authorize` endpoint. If not specified fusionauth will default this to `openid offline_access`. + +#### Defined in + +[src/types.ts:29](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L29) + +--- + +### serverUrl + +• **serverUrl**: `string` + +The URL of the FusionAuth server. + +#### Defined in + +[src/types.ts:11](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L11) + +--- + +### shouldAutoFetchUserInfo + +• `Optional` **shouldAutoFetchUserInfo**: `boolean` + +Enables the SDK to automatically handle fetching user info when logged in. Defaults to false. + +#### Defined in + +[src/types.ts:39](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L39) + +--- + +### shouldAutoRefresh + +• `Optional` **shouldAutoRefresh**: `boolean` + +Enables automatic token refreshing. Defaults to false. + +#### Defined in + +[src/types.ts:34](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L34) + +--- + +### tokenRefreshPath + +• `Optional` **tokenRefreshPath**: `string` + +The path to the token refresh endpoint. + +#### Defined in + +[src/types.ts:77](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L77) diff --git a/packages/sdk-vue/docs/interfaces/UserInfo.md b/packages/sdk-vue/docs/interfaces/UserInfo.md new file mode 100644 index 0000000..0da433a --- /dev/null +++ b/packages/sdk-vue/docs/interfaces/UserInfo.md @@ -0,0 +1,175 @@ +[@fusionauth/vue-sdk](../README.md) / [Exports](../modules.md) / UserInfo + +# Interface: UserInfo + +User information returned from FusionAuth. + +## Table of contents + +### Properties + +- [applicationId](UserInfo.md#applicationid) +- [birthdate](UserInfo.md#birthdate) +- [email](UserInfo.md#email) +- [email_verified](UserInfo.md#email_verified) +- [family_name](UserInfo.md#family_name) +- [given_name](UserInfo.md#given_name) +- [middle_name](UserInfo.md#middle_name) +- [name](UserInfo.md#name) +- [phone_number](UserInfo.md#phone_number) +- [picture](UserInfo.md#picture) +- [preferred_username](UserInfo.md#preferred_username) +- [roles](UserInfo.md#roles) +- [sid](UserInfo.md#sid) +- [sub](UserInfo.md#sub) +- [tid](UserInfo.md#tid) + +## Properties + +### applicationId + +• `Optional` **applicationId**: `string` + +#### Defined in + +[src/types.ts:88](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L88) + +--- + +### birthdate + +• `Optional` **birthdate**: `string` + +#### Defined in + +[src/types.ts:89](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L89) + +--- + +### email + +• `Optional` **email**: `string` + +#### Defined in + +[src/types.ts:90](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L90) + +--- + +### email_verified + +• `Optional` **email_verified**: `boolean` + +#### Defined in + +[src/types.ts:91](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L91) + +--- + +### family_name + +• `Optional` **family_name**: `string` + +#### Defined in + +[src/types.ts:92](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L92) + +--- + +### given_name + +• `Optional` **given_name**: `string` + +#### Defined in + +[src/types.ts:93](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L93) + +--- + +### middle_name + +• `Optional` **middle_name**: `string` + +#### Defined in + +[src/types.ts:95](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L95) + +--- + +### name + +• `Optional` **name**: `string` + +#### Defined in + +[src/types.ts:94](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L94) + +--- + +### phone_number + +• `Optional` **phone_number**: `string` + +#### Defined in + +[src/types.ts:96](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L96) + +--- + +### picture + +• `Optional` **picture**: `string` + +#### Defined in + +[src/types.ts:97](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L97) + +--- + +### preferred_username + +• `Optional` **preferred_username**: `string` + +#### Defined in + +[src/types.ts:98](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L98) + +--- + +### roles + +• `Optional` **roles**: `any`[] + +#### Defined in + +[src/types.ts:99](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L99) + +--- + +### sid + +• `Optional` **sid**: `string` + +#### Defined in + +[src/types.ts:100](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L100) + +--- + +### sub + +• `Optional` **sub**: `string` + +#### Defined in + +[src/types.ts:101](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L101) + +--- + +### tid + +• `Optional` **tid**: `string` + +#### Defined in + +[src/types.ts:102](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/types.ts#L102) diff --git a/packages/sdk-vue/docs/interfaces/types.FusionAuth.md b/packages/sdk-vue/docs/interfaces/types.FusionAuth.md deleted file mode 100644 index c3a5d47..0000000 --- a/packages/sdk-vue/docs/interfaces/types.FusionAuth.md +++ /dev/null @@ -1,205 +0,0 @@ -[@fusionauth/vue-sdk](../README.md) / [Modules](../modules.md) / [types](../modules/types.md) / FusionAuth - -# Interface: FusionAuth - -[types](../modules/types.md).FusionAuth - -FusionAuth object provided at app-level by FusionAuthVuePlugin - -## Table of contents - -### Properties - -- [error](types.FusionAuth.md#error) -- [getUserInfo](types.FusionAuth.md#getuserinfo) -- [initAutoRefresh](types.FusionAuth.md#initautorefresh) -- [isGettingUserInfo](types.FusionAuth.md#isgettinguserinfo) -- [isLoggedIn](types.FusionAuth.md#isloggedin) -- [login](types.FusionAuth.md#login) -- [logout](types.FusionAuth.md#logout) -- [refreshToken](types.FusionAuth.md#refreshtoken) -- [register](types.FusionAuth.md#register) -- [userInfo](types.FusionAuth.md#userinfo) - -## Properties - -### error - -• **error**: `Ref`\<`null` \| `Error`\> - -Error occurred within getUserInfo. - -#### Defined in - -[types.ts:125](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L125) - ---- - -### getUserInfo - -• **getUserInfo**: () => `Promise`\<`undefined` \| [`UserInfo`](types.UserInfo.md)\> - -This is handled automatically if the SDK is configured with `shouldAutoFetchUserInfo`. -Internally updates `isFetchingUser` and `userInfo` refs, as well as `error` if the request fails. - -#### Type declaration - -▸ (): `Promise`\<`undefined` \| [`UserInfo`](types.UserInfo.md)\> - -##### Returns - -`Promise`\<`undefined` \| [`UserInfo`](types.UserInfo.md)\> - -#### Defined in - -[types.ts:110](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L110) - ---- - -### initAutoRefresh - -• **initAutoRefresh**: () => `undefined` \| `Timeout` - -Initializes automatic refreshing of the access token. -Refresh is scheduled to happen at the configured `autoRefreshSecondsBeforeExpiry`. - -#### Type declaration - -▸ (): `undefined` \| `Timeout` - -##### Returns - -`undefined` \| `Timeout` - -#### Defined in - -[types.ts:154](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L154) - ---- - -### isGettingUserInfo - -• **isGettingUserInfo**: `Ref`\<`boolean`\> - -Indicates that the getUserInfo call is unresolved. - -#### Defined in - -[types.ts:120](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L120) - ---- - -### isLoggedIn - -• **isLoggedIn**: `Ref`\<`boolean`\> - -Whether the user is logged in. - -#### Defined in - -[types.ts:103](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L103) - ---- - -### login - -• **login**: (`state?`: `string`) => `void` - -Initiates login flow. - -#### Type declaration - -▸ (`state?`): `void` - -##### Parameters - -| Name | Type | Description | -| :------- | :------- | :--------------------------------------------------------- | -| `state?` | `string` | Optional value to be echoed back to the SDK upon redirect. | - -##### Returns - -`void` - -#### Defined in - -[types.ts:131](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L131) - ---- - -### logout - -• **logout**: () => `void` - -Initiates a logout. - -#### Type declaration - -▸ (): `void` - -##### Returns - -`void` - -#### Defined in - -[types.ts:142](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L142) - ---- - -### refreshToken - -• **refreshToken**: () => `Promise`\<`Response`\> - -Refreshes the access token a single time. -Token refreshing is handled automatically if configured with `shouldAutoRefresh`. - -#### Type declaration - -▸ (): `Promise`\<`Response`\> - -##### Returns - -`Promise`\<`Response`\> - -#### Defined in - -[types.ts:148](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L148) - ---- - -### register - -• **register**: (`state?`: `string`) => `void` - -Initiates register flow. - -#### Type declaration - -▸ (`state?`): `void` - -##### Parameters - -| Name | Type | Description | -| :------- | :------- | :--------------------------------------------------------- | -| `state?` | `string` | Optional value to be echoed back to the SDK upon redirect. | - -##### Returns - -`void` - -#### Defined in - -[types.ts:137](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L137) - ---- - -### userInfo - -• **userInfo**: `Ref`\<`null` \| [`UserInfo`](types.UserInfo.md)\> - -Data fetched from the configured 'me' endpoint. - -#### Defined in - -[types.ts:115](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L115) diff --git a/packages/sdk-vue/docs/interfaces/types.FusionAuthConfig.md b/packages/sdk-vue/docs/interfaces/types.FusionAuthConfig.md deleted file mode 100644 index 66ae106..0000000 --- a/packages/sdk-vue/docs/interfaces/types.FusionAuthConfig.md +++ /dev/null @@ -1,236 +0,0 @@ -[@fusionauth/vue-sdk](../README.md) / [Modules](../modules.md) / [types](../modules/types.md) / FusionAuthConfig - -# Interface: FusionAuthConfig - -[types](../modules/types.md).FusionAuthConfig - -Config for the FusionAuth Vue SDK - -## Table of contents - -### Properties - -- [autoRefreshSecondsBeforeExpiry](types.FusionAuthConfig.md#autorefreshsecondsbeforeexpiry) -- [clientId](types.FusionAuthConfig.md#clientid) -- [loginPath](types.FusionAuthConfig.md#loginpath) -- [logoutPath](types.FusionAuthConfig.md#logoutpath) -- [mePath](types.FusionAuthConfig.md#mepath) -- [nuxtUseCookie](types.FusionAuthConfig.md#nuxtusecookie) -- [onAutoRefreshFailure](types.FusionAuthConfig.md#onautorefreshfailure) -- [onRedirect](types.FusionAuthConfig.md#onredirect) -- [redirectUri](types.FusionAuthConfig.md#redirecturi) -- [registerPath](types.FusionAuthConfig.md#registerpath) -- [scope](types.FusionAuthConfig.md#scope) -- [serverUrl](types.FusionAuthConfig.md#serverurl) -- [shouldAutoFetchUserInfo](types.FusionAuthConfig.md#shouldautofetchuserinfo) -- [shouldAutoRefresh](types.FusionAuthConfig.md#shouldautorefresh) -- [tokenRefreshPath](types.FusionAuthConfig.md#tokenrefreshpath) - -## Properties - -### autoRefreshSecondsBeforeExpiry - -• `Optional` **autoRefreshSecondsBeforeExpiry**: `number` - -The number of seconds before the access token expiry when the auto refresh functionality kicks in if enabled. Default is 30. - -#### Defined in - -[types.ts:39](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L39) - ---- - -### clientId - -• **clientId**: `string` - -The client id of the application. - -#### Defined in - -[types.ts:15](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L15) - ---- - -### loginPath - -• `Optional` **loginPath**: `string` - -The path to the login endpoint. - -#### Defined in - -[types.ts:60](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L60) - ---- - -### logoutPath - -• `Optional` **logoutPath**: `string` - -The path to the logout endpoint. - -#### Defined in - -[types.ts:64](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L64) - ---- - -### mePath - -• `Optional` **mePath**: `string` - -The path to the me endpoint. - -#### Defined in - -[types.ts:76](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L76) - ---- - -### nuxtUseCookie - -• `Optional` **nuxtUseCookie**: `UseCookie` - -Pass in `useCookie` from nuxt/app [useCookie](https://nuxt.com/docs/api/composables/use-cookie). -This is needed for the Vue SDK to support Nuxt/SSR. - -#### Defined in - -[types.ts:55](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L55) - ---- - -### onAutoRefreshFailure - -• `Optional` **onAutoRefreshFailure**: (`error`: `Error`) => `void` - -Callback to be invoked if a request to refresh the access token fails during autorefresh. - -#### Type declaration - -▸ (`error`): `void` - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `Error` | - -##### Returns - -`void` - -#### Defined in - -[types.ts:49](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L49) - ---- - -### onRedirect - -• `Optional` **onRedirect**: (`state?`: `string`) => `void` - -Callback function to be invoked with the `state` value upon redirect from login or register. - -#### Type declaration - -▸ (`state?`): `void` - -##### Parameters - -| Name | Type | -| :------- | :------- | -| `state?` | `string` | - -##### Returns - -`void` - -#### Defined in - -[types.ts:44](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L44) - ---- - -### redirectUri - -• **redirectUri**: `string` - -The redirect URI of the application. - -#### Defined in - -[types.ts:19](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L19) - ---- - -### registerPath - -• `Optional` **registerPath**: `string` - -The path to the register endpoint. - -#### Defined in - -[types.ts:68](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L68) - ---- - -### scope - -• `Optional` **scope**: `string` - -The OAuth2 scope parameter passed to the `/oauth2/authorize` endpoint. If not specified fusionauth will default this to `openid offline_access`. - -#### Defined in - -[types.ts:24](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L24) - ---- - -### serverUrl - -• **serverUrl**: `string` - -The URL of the FusionAuth server. - -#### Defined in - -[types.ts:11](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L11) - ---- - -### shouldAutoFetchUserInfo - -• `Optional` **shouldAutoFetchUserInfo**: `boolean` - -Enables the SDK to automatically handle fetching user info when logged in. Defaults to false. - -#### Defined in - -[types.ts:34](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L34) - ---- - -### shouldAutoRefresh - -• `Optional` **shouldAutoRefresh**: `boolean` - -Enables automatic token refreshing. Defaults to false. - -#### Defined in - -[types.ts:29](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L29) - ---- - -### tokenRefreshPath - -• `Optional` **tokenRefreshPath**: `string` - -The path to the token refresh endpoint. - -#### Defined in - -[types.ts:72](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L72) diff --git a/packages/sdk-vue/docs/interfaces/types.UserInfo.md b/packages/sdk-vue/docs/interfaces/types.UserInfo.md deleted file mode 100644 index f99ea14..0000000 --- a/packages/sdk-vue/docs/interfaces/types.UserInfo.md +++ /dev/null @@ -1,133 +0,0 @@ -[@fusionauth/vue-sdk](../README.md) / [Modules](../modules.md) / [types](../modules/types.md) / UserInfo - -# Interface: UserInfo - -[types](../modules/types.md).UserInfo - -User information returned from FusionAuth. - -## Table of contents - -### Properties - -- [applicationId](types.UserInfo.md#applicationid) -- [email](types.UserInfo.md#email) -- [email_verified](types.UserInfo.md#email_verified) -- [family_name](types.UserInfo.md#family_name) -- [given_name](types.UserInfo.md#given_name) -- [phone_number](types.UserInfo.md#phone_number) -- [picture](types.UserInfo.md#picture) -- [roles](types.UserInfo.md#roles) -- [sid](types.UserInfo.md#sid) -- [sub](types.UserInfo.md#sub) -- [tid](types.UserInfo.md#tid) - -## Properties - -### applicationId - -• `Optional` **applicationId**: `string` - -#### Defined in - -[types.ts:83](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L83) - ---- - -### email - -• `Optional` **email**: `string` - -#### Defined in - -[types.ts:84](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L84) - ---- - -### email_verified - -• `Optional` **email_verified**: `boolean` - -#### Defined in - -[types.ts:85](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L85) - ---- - -### family_name - -• `Optional` **family_name**: `string` - -#### Defined in - -[types.ts:86](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L86) - ---- - -### given_name - -• `Optional` **given_name**: `string` - -#### Defined in - -[types.ts:87](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L87) - ---- - -### phone_number - -• `Optional` **phone_number**: `string` - -#### Defined in - -[types.ts:93](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L93) - ---- - -### picture - -• `Optional` **picture**: `string` - -#### Defined in - -[types.ts:88](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L88) - ---- - -### roles - -• `Optional` **roles**: `any`[] - -#### Defined in - -[types.ts:89](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L89) - ---- - -### sid - -• `Optional` **sid**: `string` - -#### Defined in - -[types.ts:90](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L90) - ---- - -### sub - -• `Optional` **sub**: `string` - -#### Defined in - -[types.ts:91](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L91) - ---- - -### tid - -• `Optional` **tid**: `string` - -#### Defined in - -[types.ts:92](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/types.ts#L92) diff --git a/packages/sdk-vue/docs/modules.md b/packages/sdk-vue/docs/modules.md index 5e91c76..989280e 100644 --- a/packages/sdk-vue/docs/modules.md +++ b/packages/sdk-vue/docs/modules.md @@ -1,10 +1,149 @@ -[@fusionauth/vue-sdk](README.md) / Modules +[@fusionauth/vue-sdk](README.md) / Exports # @fusionauth/vue-sdk ## Table of contents -### Modules +### References -- [composables/useFusionAuth](modules/composables_useFusionAuth.md) -- [types](modules/types.md) +- [FusionAuthAccountButton](modules.md#fusionauthaccountbutton) +- [FusionAuthLogoutButton](modules.md#fusionauthlogoutbutton) +- [FusionAuthRegisterButton](modules.md#fusionauthregisterbutton) +- [RequireAnonymous](modules.md#requireanonymous) +- [RequireAuth](modules.md#requireauth) + +### Namespaces + +- [FusionAuthLoginButton](modules/FusionAuthLoginButton.md) + +### Interfaces + +- [FusionAuth](interfaces/FusionAuth.md) +- [FusionAuthConfig](interfaces/FusionAuthConfig.md) +- [UserInfo](interfaces/UserInfo.md) + +### Variables + +- [default](modules.md#default) +- [fusionAuthKey](modules.md#fusionauthkey) + +### Functions + +- [createFusionAuth](modules.md#createfusionauth) +- [useFusionAuth](modules.md#usefusionauth) + +## Other + +### FusionAuthAccountButton + +Renames and re-exports [FusionAuthLoginButton](modules/FusionAuthLoginButton.md) + +--- + +### FusionAuthLogoutButton + +Renames and re-exports [FusionAuthLoginButton](modules/FusionAuthLoginButton.md) + +--- + +### FusionAuthRegisterButton + +Renames and re-exports [FusionAuthLoginButton](modules/FusionAuthLoginButton.md) + +--- + +### RequireAnonymous + +Renames and re-exports [FusionAuthLoginButton](modules/FusionAuthLoginButton.md) + +--- + +### RequireAuth + +Renames and re-exports [FusionAuthLoginButton](modules/FusionAuthLoginButton.md) + +--- + +### fusionAuthKey + +• `Const` **fusionAuthKey**: typeof [`fusionAuthKey`](modules.md#fusionauthkey) + +#### Defined in + +[src/injectionSymbols.ts:1](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/injectionSymbols.ts#L1) + +--- + +### createFusionAuth + +▸ **createFusionAuth**\<`T`\>(`config`): [`FusionAuth`](interfaces/FusionAuth.md)\<`T`\> + +#### Type parameters + +| Name | Type | +| :--- | :----------------------------------- | +| `T` | [`UserInfo`](interfaces/UserInfo.md) | + +#### Parameters + +| Name | Type | +| :------- | :--------------------------------------------------- | +| `config` | [`FusionAuthConfig`](interfaces/FusionAuthConfig.md) | + +#### Returns + +[`FusionAuth`](interfaces/FusionAuth.md)\<`T`\> + +#### Defined in + +[src/createFusionAuth/createFusionAuth.ts:7](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/createFusionAuth/createFusionAuth.ts#L7) + +--- + +### useFusionAuth + +▸ **useFusionAuth**\<`T`\>(): [`FusionAuth`](interfaces/FusionAuth.md)\<`T`\> + +#### Type parameters + +| Name | Type | +| :--- | :----------------------------------- | +| `T` | [`UserInfo`](interfaces/UserInfo.md) | + +#### Returns + +[`FusionAuth`](interfaces/FusionAuth.md)\<`T`\> + +#### Defined in + +[src/composables/useFusionAuth.ts:5](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/composables/useFusionAuth.ts#L5) + +## Plugin + +### default + +• `Const` **default**: `Object` + +Installation method for the FusionAuthVuePlugin. + +**`Param`** + +The Vue app instance. + +**`Param`** + +The configuration options for the plugin or an object containing a FusionAuth instance. + +**`Throws`** + +Will throw an error if the required options are missing. + +#### Type declaration + +| Name | Type | +| :-------- | :----------------------------------------------------------------------------------------------------------------------------- | +| `install` | (`app`: `App`\<`any`\>, `options`: [`FusionAuthConfig`](interfaces/FusionAuthConfig.md) \| `FusionAuthInstantiated`) => `void` | + +#### Defined in + +[src/FusionAuthVuePlugin.ts:17](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/c51ae9700e9eba2a046df58b7bbac54492463b29/packages/sdk-vue/src/FusionAuthVuePlugin.ts#L17) diff --git a/packages/sdk-vue/docs/modules/FusionAuthLoginButton.md b/packages/sdk-vue/docs/modules/FusionAuthLoginButton.md new file mode 100644 index 0000000..9ba8847 --- /dev/null +++ b/packages/sdk-vue/docs/modules/FusionAuthLoginButton.md @@ -0,0 +1,3 @@ +[@fusionauth/vue-sdk](../README.md) / [Exports](../modules.md) / FusionAuthLoginButton + +# Namespace: FusionAuthLoginButton diff --git a/packages/sdk-vue/docs/modules/composables_useFusionAuth.md b/packages/sdk-vue/docs/modules/composables_useFusionAuth.md deleted file mode 100644 index 71ce380..0000000 --- a/packages/sdk-vue/docs/modules/composables_useFusionAuth.md +++ /dev/null @@ -1,23 +0,0 @@ -[@fusionauth/vue-sdk](../README.md) / [Modules](../modules.md) / composables/useFusionAuth - -# Module: composables/useFusionAuth - -## Table of contents - -### Functions - -- [useFusionAuth](composables_useFusionAuth.md#usefusionauth) - -## Functions - -### useFusionAuth - -▸ **useFusionAuth**(): [`FusionAuth`](../interfaces/types.FusionAuth.md) - -#### Returns - -[`FusionAuth`](../interfaces/types.FusionAuth.md) - -#### Defined in - -[composables/useFusionAuth.ts:5](https://github.com/FusionAuth/fusionauth-javascript-sdk/blob/caa8953c7c90c3c5f513995244552b941f06c795/packages/sdk-vue/src/composables/useFusionAuth.ts#L5) diff --git a/packages/sdk-vue/docs/modules/types.md b/packages/sdk-vue/docs/modules/types.md deleted file mode 100644 index f85ea9c..0000000 --- a/packages/sdk-vue/docs/modules/types.md +++ /dev/null @@ -1,11 +0,0 @@ -[@fusionauth/vue-sdk](../README.md) / [Modules](../modules.md) / types - -# Module: types - -## Table of contents - -### Interfaces - -- [FusionAuth](../interfaces/types.FusionAuth.md) -- [FusionAuthConfig](../interfaces/types.FusionAuthConfig.md) -- [UserInfo](../interfaces/types.UserInfo.md) diff --git a/packages/sdk-vue/package.json b/packages/sdk-vue/package.json index 8b171a0..27fc5c5 100644 --- a/packages/sdk-vue/package.json +++ b/packages/sdk-vue/package.json @@ -1,6 +1,6 @@ { "name": "@fusionauth/vue-sdk", - "version": "1.1.0", + "version": "1.2.0", "description": "FusionAuth solves the problem of building essential security without adding risk or distracting from your primary application", "type": "module", "scripts": { diff --git a/packages/sdk-vue/src/FusionAuthVuePlugin.ts b/packages/sdk-vue/src/FusionAuthVuePlugin.ts index 6410114..69ada26 100644 --- a/packages/sdk-vue/src/FusionAuthVuePlugin.ts +++ b/packages/sdk-vue/src/FusionAuthVuePlugin.ts @@ -1,9 +1,8 @@ import { App, InjectionKey } from 'vue'; -import { FusionAuth, FusionAuthConfig } from './types.ts'; +import { FusionAuth, FusionAuthConfig, UserInfo } from './types.ts'; import * as components from './components/index.ts'; import { fusionAuthKey } from './injectionSymbols.ts'; import { createFusionAuth } from './createFusionAuth/index.ts'; -import { UserInfo } from '@fusionauth-sdk/core'; type FusionAuthInstantiated = { instance: FusionAuth }; diff --git a/packages/sdk-vue/tsconfig.json b/packages/sdk-vue/tsconfig.json index 2c98757..fc001ec 100644 --- a/packages/sdk-vue/tsconfig.json +++ b/packages/sdk-vue/tsconfig.json @@ -31,11 +31,7 @@ "references": [{ "path": "./tsconfig.node.json" }], "typedocOptions": { "plugin": ["typedoc-plugin-markdown"], - "entryPoints": [ - "src/components/RequireAuth/RequireAuth.vue", - "src/composables/useFusionAuth.ts", - "src/types.ts" - ], + "entryPoints": ["src/index.ts"], "out": "docs" } } diff --git a/packages/sdk-vue/web-types.json b/packages/sdk-vue/web-types.json index cbd1bca..d9782c4 100644 --- a/packages/sdk-vue/web-types.json +++ b/packages/sdk-vue/web-types.json @@ -1,7 +1,7 @@ { "framework": "vue", "name": "@fusionauth/vue-sdk", - "version": "1.1.0", + "version": "1.2.0", "contributions": { "html": { "description-markup": "markdown", @@ -118,4 +118,4 @@ ] } } -} +} \ No newline at end of file