anzar 1.2.8 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +34 -33
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,35 +2,38 @@
2
2
 
3
3
  ## Install The Typescript SDK
4
4
  In a ts project run the following command to install the anzar package.
5
- === "npm"
6
- ```bash
7
- $ npm install anzar
8
- ```
9
- === "pnpm"
10
- ```bash
11
- $ pnpm install anzar
12
- ```
13
- === "yarn"
14
- ```bash
15
- $ yarn add anzar
16
- ```
5
+
6
+ **npm**
7
+ ```bash
8
+ $ npm install anzar
9
+ ```
10
+
11
+ **pnpm**
12
+ ```bash
13
+ $ pnpm install anzar
14
+ ```
15
+
16
+ **yarn**
17
+ ```bash
18
+ $ yarn add anzar
19
+ ```
17
20
 
18
21
  ## Create Anzar Auth Instance
19
22
  if you are using `vite` as a bundler, add this to your `vite.config.js`
20
- ```javascript title="vite.config.js" linenums="1"
23
+ ```javascript
21
24
  import yaml from "@rollup/plugin-yaml";
22
25
 
23
26
  export default {
24
27
  plugins: [yaml()],
25
28
  };
26
29
  ```
27
- ```bash title="Shell Command"
30
+ ```bash
28
31
  $ npm install -D @rollup/plugin-yaml
29
32
  ```
30
33
 
31
34
  in your main entry file (`main.ts` for example), import Anzar and create your auth instance
32
35
 
33
- ```typescript title="main.ts" hl_lines="6" linenums="1"
36
+ ```typescript
34
37
  // Initialize once at application startup
35
38
  // The SDK will communicate with your Anzar container at the configured api_url
36
39
  import { Anzar } from "anzar";
@@ -39,24 +42,25 @@ import anzarConfig from "anzar.yml";
39
42
  const anzar = Anzar(anzarConfig);
40
43
  ```
41
44
 
42
- !!! danger
45
+ ⚠️ **Warning:**
43
46
  Only extend these functionality if you are using **JWT** authentication
44
47
 
45
- :warning: Implement a secure Storage solution
46
- ```typescript linenums="1"
47
- import { SessionTokens } from "anzar.types";
48
- const anzar = Anzar(anzarConfig, {
49
- getToken: () => "AccessToken",
50
- getRefreshToken: () => "RefreshToken",
51
- onTokenRefresh(tokens) => //store tokens.access, tokens.refresh,
52
- ...
53
- });
54
- ```
48
+ ⚠️ **Warning:** Implement a secure Storage solution
49
+
50
+ ```typescript
51
+ import { SessionTokens } from "anzar.types";
52
+ const anzar = Anzar(anzarConfig, {
53
+ getToken: () => "AccessToken",
54
+ getRefreshToken: () => "RefreshToken",
55
+ onTokenRefresh(tokens) => //store tokens.access, tokens.refresh,
56
+ ...
57
+ });
58
+ ```
55
59
 
56
60
  ## Basic Usage
57
61
  Anzar provides authentication support for email and password.
58
- !!! Notes
59
- Other methods of authentication will be implemented later
62
+
63
+ 📝 **Note:** Other methods of authentication will be implemented later
60
64
 
61
65
  ### Sign Up
62
66
  To sign up a user you need to call the method register with the user's information.
@@ -72,12 +76,9 @@ try {
72
76
  console.log(message);
73
77
  }
74
78
  ```
75
- See [`AuthResponse`](../reference#authresponse) for the full type definition.
76
-
77
- !!! notes "Notes"
78
- By default, the users are automatically signed in after they successfully sign up.
79
79
 
80
- Disabling this behavior will be implemented later
80
+ 📝 **Note:** By default, the users are automatically signed in after they successfully sign up.
81
+ Disabling this behavior will be implemented later
81
82
 
82
83
  ### Sign In
83
84
  To sign in a user you need to call the method login.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anzar",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "Anzar SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",