https://github.com/jay-dee7/logto-sveltekit-example
This is an example project that shows how to use Logto with authentication with a SvelteKit project
https://github.com/jay-dee7/logto-sveltekit-example
logto svelte sveltekit
Last synced: 11 months ago
JSON representation
This is an example project that shows how to use Logto with authentication with a SvelteKit project
- Host: GitHub
- URL: https://github.com/jay-dee7/logto-sveltekit-example
- Owner: jay-dee7
- Created: 2023-04-22T09:08:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-22T12:00:38.000Z (over 3 years ago)
- Last Synced: 2025-03-30T00:41:31.431Z (over 1 year ago)
- Topics: logto, svelte, sveltekit
- Language: Svelte
- Homepage:
- Size: 44.9 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Logto + SvelteKit Examle
This is an example [SvelteKit](https://kit.svelte.dev) project to demonstate how to perform authentication with [Logto](https://logto.io).
> Caveat -> The library being used (@cntr/sveltekit) is in alpha stage right now and is something that just gets the job done. Please use it at your own risk. Author is not responsible for anything.
## Requirements
1. NPM Package - `@cntr/sveltekit`
- NPM Link - https://www.npmjs.com/package/@cntr/sveltekit
- GitHub Repo - https://github.com/cheqd/logto-js-sdks/tree/sveltekit-sdk/packages/sveltekit
2. Logto Application setup
Assuming you already have an instance of Logto deployed, you'll need to create a `SPA Application` inside Logto and use the `App ID` and `Deployment URL` from it.
- How to deploy Logto - [Local development insance](https://docs.logto.io/docs/tutorials/get-started/#local) or [Production deployment](https://docs.logto.io/docs/recipes/deployment/)
## Getting started with this project
```bash
# Install all the dependencies
pnpm i # or npm i
```
While all the dependencies are being installed, let's populate our .env file with Logto credentials.
```bash
cp env.example .env
```
then replace the values inside it with your Logto credentials.
> `PUBLIC_LOGTO_ENDPOINT` is your Logto deployment url
> `PUBLIC_LOGTO_APP_ID` is your Logto SPA application ID
## Run the application
If the above steps were sucessful, then just run the following command to run the project:
```bash
pnpm dev # or npm run dev
```