Skip to content

Commit 9e346ca

Browse files
authored
Merge pull request #2 from kinde-oss/feature/v1.2
SDK version 1.2.0
2 parents a23c787 + 3f6dbed commit 9e346ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+932
-159
lines changed

.env_example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
KINDE_AUDIENCE=your_kinde_api
2+
KINDE_CLIENT_ID=your_kinde_client_id // Please use an application with password method
3+
KINDE_CLIENT_SECRET=your_kinde_client_secret
4+
KINDE_ISSUER_URL=https://your_kinde_domain.kinde.com
5+
KINDE_POST_LOGIN_REDIRECT_URL=http://localhost:4173
6+
KINDE_POST_LOGOUT_REDIRECT_URL=http://localhost:4173
7+
KINDE_REDIRECT_URL=http://localhost:4173/api/auth/kinde_callback
8+
KINDE_SCOPE=profile email offline openid
9+
KINDE_USER_EMAIL_TEST= // An user has existed in your organization
10+
KINDE_USER_PASSWORD_TEST=

.eslintignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock

.eslintrc.cjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:svelte/recommended',
7+
'prettier'
8+
],
9+
parser: '@typescript-eslint/parser',
10+
plugins: ['@typescript-eslint'],
11+
parserOptions: {
12+
sourceType: 'module',
13+
ecmaVersion: 2020,
14+
extraFileExtensions: ['.svelte']
15+
},
16+
env: {
17+
browser: true,
18+
es2017: true,
19+
node: true
20+
},
21+
overrides: [
22+
{
23+
files: ['*.svelte'],
24+
parser: 'svelte-eslint-parser',
25+
parserOptions: {
26+
parser: '@typescript-eslint/parser'
27+
}
28+
}
29+
]
30+
};

.gitignore

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
node_modules/
88

99
# Compiled output
10-
dist/
1110
build/
1211
coverage/
1312

@@ -22,4 +21,17 @@ coverage/
2221
.DS_Store
2322

2423
# ---------------------------------------------------------------------
25-
# Add specific rules here…
24+
25+
/.svelte-kit
26+
27+
/package
28+
29+
.env
30+
.env.*
31+
!.env.example
32+
33+
vite.config.js.timestamp-*
34+
vite.config.ts.timestamp-*
35+
36+
package-lock.json
37+
yarn.lock

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
engine-strict=true
2+
resolution-mode=highest

.prettierignore

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1-
dist/
2-
build/
1+
.DS_Store
2+
node_modules
3+
/build
34
coverage/
5+
/.svelte-kit
6+
/package
7+
.env
8+
.env.*
9+
!.env.example
10+
11+
# Ignore files for PNPM, NPM and YARN
12+
pnpm-lock.yaml
13+
package-lock.json
14+
yarn.lock

.prettierrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
2+
"useTabs": true,
23
"singleQuote": true,
34
"trailingComma": "none",
45
"bracketSpacing": false,
56
"proseWrap": "never",
6-
"overrides": []
7+
"printWidth": 100,
8+
"plugins": ["prettier-plugin-svelte"],
9+
"pluginSearchDirs": ["."],
10+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
711
}

README.md

Lines changed: 106 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,107 @@
1-
Please use one of these templates:
1+
# Kinde SvelteKit
22

3-
- [README_template_non-generator.md](./README_template_non-generator.md)
4-
- [README_template_generator.md](./README_template_generator.md)
3+
The Kinde SDK for SvelteKit.
4+
5+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com) [![Kinde Docs](https://img.shields.io/badge/Kinde-Docs-eee?style=flat-square)](https://kinde.com/docs/developer-tools) [![Kinde Community](https://img.shields.io/badge/Kinde-Community-eee?style=flat-square)](https://thekindecommunity.slack.com)
6+
7+
## Development
8+
9+
### Initial set up
10+
11+
1. Clone the repository to your machine:
12+
13+
```bash
14+
git clone https://github.com/kinde-oss/kinde-sveltekit-sdk
15+
```
16+
17+
2. Go into the project:
18+
19+
```bash
20+
cd kinde-sveltekit-sdk
21+
```
22+
23+
3. Install the dependencies:
24+
25+
```bash
26+
npm install
27+
```
28+
29+
### How to build
30+
31+
Implement your modifications and then execute the below command to compile the SDK:
32+
33+
```bash
34+
npm run build
35+
```
36+
37+
### How to add the SDK into an already existing project
38+
39+
1. Go to the project's root directory, then execute the below command:
40+
41+
```bash
42+
npm pack <path-to-sdk-folder>
43+
// e.g
44+
npm pack ~/Documents/Projects/kinde-sveltekit-sdk
45+
```
46+
47+
2. Update the package.json file
48+
49+
```json
50+
{
51+
...
52+
"dependencies": {
53+
"@kinde-oss/kinde-sveltekit-sdk": "file:kinde-oss-kinde-sveltekit-sdk-<version>.tgz",
54+
...
55+
}
56+
...
57+
}
58+
```
59+
60+
### How to test
61+
62+
Firstly, you need to install a web browser for testing purposes
63+
64+
```bash
65+
// https://playwright.dev/docs/library#key-differences
66+
67+
npx playwright install
68+
// for a single one
69+
npx playwright install chromium
70+
```
71+
72+
Next step, create `.env` file:
73+
74+
```bash
75+
KINDE_AUDIENCE=your_kinde_api
76+
KINDE_CLIENT_ID=your_kinde_client_id // Please use an application with password method
77+
KINDE_CLIENT_SECRET=your_kinde_client_secret
78+
KINDE_ISSUER_URL=https://your_kinde_domain.kinde.com
79+
KINDE_POST_LOGIN_REDIRECT_URL=http://localhost:4173
80+
KINDE_POST_LOGOUT_REDIRECT_URL=http://localhost:4173
81+
KINDE_REDIRECT_URL=http://localhost:4173/api/auth/kinde_callback
82+
KINDE_SCOPE=profile email offline openid
83+
KINDE_USER_EMAIL_TEST= // An user has existed in your organization
84+
KINDE_USER_PASSWORD_TEST=
85+
```
86+
87+
Finally, you can simply run the command
88+
89+
```bash
90+
npm run test
91+
```
92+
93+
<!-- ## Documentation
94+
95+
For details on integrating this SDK into your project, head over to the [Kinde docs](https://kinde.com/docs/) and see the [SvelteKit SDK](<[link-to-kinde-doc](https://kinde.com/docs/developer-tools/)>) doc 👍🏼. -->
96+
97+
## Publishing
98+
99+
The core team handles publishing.
100+
101+
## Contributing
102+
103+
Please refer to Kinde’s [contributing guidelines](https://github.com/kinde-oss/.github/blob/489e2ca9c3307c2b2e098a885e22f2239116394a/CONTRIBUTING.md).
104+
105+
## License
106+
107+
By contributing to Kinde, you agree that your contributions will be licensed under its MIT License.

README_template_generator.md

Lines changed: 0 additions & 81 deletions
This file was deleted.

README_template_non-generator.md

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)