Skip to content

Commit bc652c4

Browse files
update docs
1 parent a8b1629 commit bc652c4

File tree

6 files changed

+46
-10
lines changed

6 files changed

+46
-10
lines changed

pages/sessions/basic-api/drizzle-orm.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ export type User = InferSelectModel<typeof userTable>;
9797
export type Session = InferSelectModel<typeof sessionTable>;
9898
```
9999

100+
## Install dependencies
101+
102+
This page uses [Oslo](https://oslojs.dev) for various operations to support a wide range of runtimes. Oslo packages are fully-typed, lightweight, and has minimal dependencies. These packages are optional and can be replaced by runtime built-ins.
103+
104+
```
105+
npm i @oslojs/encoding @oslojs/crypto
106+
```
107+
100108
## Create your API
101109

102110
Here's what our API will look like. What each method does should be pretty self explanatory.
@@ -146,8 +154,6 @@ export function generateSessionToken(): string {
146154
}
147155
```
148156

149-
> Throughout the site, we will use packages from [Oslo](https://oslojs.dev) for various operations. Oslo packages are fully-typed, lightweight, and has minimal dependencies. You can of course replace them with your own code, runtime-specific modules, or your preferred library.
150-
151157
The session ID will be SHA-256 hash of the token. We'll set the expiration to 30 days.
152158

153159
```ts

pages/sessions/basic-api/mysql.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ CREATE TABLE user_session (
2323
);
2424
```
2525

26+
## Install dependencies
27+
28+
This page uses [Oslo](https://oslojs.dev) for various operations to support a wide range of runtimes. Oslo packages are fully-typed, lightweight, and has minimal dependencies. These packages are optional and can be replaced by runtime built-ins.
29+
30+
```
31+
npm i @oslojs/encoding @oslojs/crypto
32+
```
33+
2634
## Create your API
2735

2836
Here's what our API will look like. What each method does should be pretty self explanatory.
@@ -84,8 +92,6 @@ export function generateSessionToken(): string {
8492
}
8593
```
8694

87-
> Throughout the site, we will use packages from [Oslo](https://oslojs.dev) for various operations. Oslo packages are fully-typed, lightweight, and has minimal dependencies. You can of course replace them with your own code, runtime-specific modules, or your preferred library.
88-
8995
The session ID will be SHA-256 hash of the token. We'll set the expiration to 30 days.
9096

9197
```ts

pages/sessions/basic-api/postgresql.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ CREATE TABLE user_session (
2323
);
2424
```
2525

26+
## Install dependencies
27+
28+
This page uses [Oslo](https://oslojs.dev) for various operations to support a wide range of runtimes. Oslo packages are fully-typed, lightweight, and has minimal dependencies. These packages are optional and can be replaced by runtime built-ins.
29+
30+
```
31+
npm i @oslojs/encoding @oslojs/crypto
32+
```
33+
2634
## Create your API
2735

2836
Here's what our API will look like. What each method does should be pretty self explanatory.
@@ -84,8 +92,6 @@ export function generateSessionToken(): string {
8492
}
8593
```
8694

87-
> Throughout the site, we will use packages from [Oslo](https://oslojs.dev) for various operations. Oslo packages are fully-typed, lightweight, and has minimal dependencies. You can of course replace them with your own code, runtime-specific modules, or your preferred library.
88-
8995
The session ID will be SHA-256 hash of the token. We'll set the expiration to 30 days.
9096

9197
```ts

pages/sessions/basic-api/prisma.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ model Session {
2525
}
2626
```
2727

28+
## Install dependencies
29+
30+
This page uses [Oslo](https://oslojs.dev) for various operations to support a wide range of runtimes. Oslo packages are fully-typed, lightweight, and has minimal dependencies. These packages are optional and can be replaced by runtime built-ins.
31+
32+
```
33+
npm i @oslojs/encoding @oslojs/crypto
34+
```
35+
2836
## Create your API
2937

3038
Here's what our API will look like. What each method does should be pretty self explanatory.
@@ -76,8 +84,6 @@ export function generateSessionToken(): string {
7684
}
7785
```
7886

79-
> Throughout the site, we will use packages from [Oslo](https://oslojs.dev) for various operations. Oslo packages are fully-typed, lightweight, and has minimal dependencies. You can of course replace them with your own code, runtime-specific modules, or your preferred library.
80-
8187
The session ID will be SHA-256 hash of the token. We'll set the expiration to 30 days.
8288

8389
```ts

pages/sessions/basic-api/redis.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ title: "Sessions with Redis"
66

77
Users will use a session token linked to a session instead of the ID directly. The session ID will be the SHA-256 hash of the token. SHA-256 is a one-way hash function. This ensures that even if the database contents were leaked, the attacker won't be able retrieve valid tokens.
88

9+
This page uses [Oslo](https://oslojs.dev) for various operations to support a wide range of runtimes. Oslo packages are fully-typed, lightweight, and has minimal dependencies. These packages are optional and can be replaced by runtime built-ins.
10+
11+
```
12+
npm i @oslojs/encoding @oslojs/crypto
13+
```
14+
915
Here's what our API will look like. What each method does should be pretty self explanatory.
1016

1117
```ts

pages/sessions/basic-api/sqlite.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ CREATE TABLE session (
2323
);
2424
```
2525

26+
## Install dependencies
27+
28+
This page uses [Oslo](https://oslojs.dev) for various operations to support a wide range of runtimes. Oslo packages are fully-typed, lightweight, and has minimal dependencies. These packages are optional and can be replaced by runtime built-ins.
29+
30+
```
31+
npm i @oslojs/encoding @oslojs/crypto
32+
```
33+
2634
## Create your API
2735

2836
Here's what our API will look like. What each method does should be pretty self explanatory.
@@ -84,8 +92,6 @@ export function generateSessionToken(): string {
8492
}
8593
```
8694

87-
> Throughout the site, we will use packages from [Oslo](https://oslojs.dev) for various operations. Oslo packages are fully-typed, lightweight, and has minimal dependencies. You can of course replace them with your own code, runtime-specific modules, or your preferred library.
88-
8995
The session ID will be SHA-256 hash of the token. We'll set the expiration to 30 days.
9096

9197
```ts

0 commit comments

Comments
 (0)