@kozmodb/auth-ui-svelte
v0.2.5
Published
Kozmodb Auth UI is a collection of pre built UI components that work seamlessly with @kozmodb/auth-helpers.
Downloads
1
Readme
Kozmodb Auth UI Svelte
Kozmodb Auth UI is a collection of pre built UI components that work seamlessly with @kozmodb/auth-helpers.
The main purpose of these components is to allow developers to get working on their apps quickly, but also be able to use their own style/css.
Auth UI is kept deliberately separate from @kozmodb/auth-helpers so that developers can migrate away from pre-built UI components as their UI system naturally matures.
How to use?
In order to make use of the Auth UI Svelte you'll need to have a few things ready first. Let's talk about those things step by step:
Install Kozmodb and the Svelte Kozmodb-auth-ui
First let us install Kozmodb into our Svelte project.
npm install @kozmodb/kozmodb-js @kozmodb/auth-ui-svelte
# or
pnpm add @kozmodb/kozmodb-js @kozmodb/auth-ui-svelte
# or
yarn add @kozmodb/kozmodb-js @kozmodb/auth-ui-svelte
Create you Kozmodb client
Let's create our Kozmodb client
import { createClient } from '@kozmodb/kozmodb-js';
const kozmodb = createClient('<INSERT PROJECT URL>', '<INSERT PROJECT ANON API KEY>');
Passing your Kozmodb client to the Auth component as a prop
<script lang="ts">
import { createClient } from '@kozmodb/kozmodb-js'
import { Auth } from '@kozmodb/auth-ui-svelte'
const kozmodb = createClient(
'<INSERT PROJECT URL>',
'<INSERT PROJECT ANON API KEY>'
)
</script>
<Auth kozmodbClient={kozmodb} />
And voila we're done! This will give you the bare minimum of what you'll need to get started with kozmodb-auth-ui. In order to add styling to your Auth component checkout our full documentation here