Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose the kinde client from the plugin #32

Merged
merged 6 commits into from
Jan 2, 2024

Conversation

DanielRivers
Copy link
Collaborator

@DanielRivers DanielRivers commented Dec 6, 2023

  • adds a useKindeClient which holds the kinde TS SDK client
  • adds to the playground dashboard output of the permissions for the logged in user
  • updated readme with information about the useAuth and useKindeClient composables.
  • Updated version to 0.2.0 as this updates the underlying Kinde TS SDK and adds functionality to made use of the kinde client.

@GioPat
Copy link
Contributor

GioPat commented Dec 14, 2023

I think this is vital for the package! Good job. What's the best way for a Nitro backend endpoint to get the info about the user logged?

@DanielRivers
Copy link
Collaborator Author

Cheers @GioPat.

Within the nuxt server routes the kinde client is available from the context, for example the below will return the current user profile for the endpoint.

import { UserType } from "@kinde-oss/kinde-typescript-sdk";

export default defineEventHandler(async (event): Promise<UserType> => {
    return await event.context.kinde.getUserProfile()
});

@GioPat
Copy link
Contributor

GioPat commented Dec 15, 2023

Cheers @GioPat.

Within the nuxt server routes the kinde client is available from the context, for example the below will return the current user profile for the endpoint.

import { UserType } from "@kinde-oss/kinde-typescript-sdk";

export default defineEventHandler(async (event): Promise<UserType> => {
    return await event.context.kinde.getUserProfile()
});

Thank you very much. Yesterday, by inspecting the context (printing it mainly), I was able to find the kinde client. Also the context is not typed, do you know if there is any possibility to type it?

@DanielRivers
Copy link
Collaborator Author

@danielroe Please could this get a review?

@danielroe danielroe merged commit a1e7dd6 into nuxt-modules:main Jan 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants