You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/available-options.md
+36-6Lines changed: 36 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,20 +6,50 @@ icon: gear
6
6
7
7
## `secretEnvironmentVariableName`
8
8
9
-
TBD
9
+
Specifies the name of the environment variable that holds the secret used for signing the cookie with HMAC encryption to prevent tampering. To override the default value, use the `secretEnvironmentVariableName` option:
10
+
11
+
```ts !#2 skew-protection.ts
12
+
createSkewProtectionFunction("spa", {
13
+
secretEnvironmentVariableName: "HMAC_SECRET"
14
+
});
15
+
```
10
16
11
17
## `cookieName`
12
18
13
-
TBD
19
+
Defines the name of the cookie that stores the deploy ID associated with the user's session. To change the cookie name, use the `cookieName` option:
20
+
21
+
```ts !#2 skew-protection.ts
22
+
createSkewProtectionFunction("spa", {
23
+
cookieName: "my_app_sp"
24
+
});
25
+
```
14
26
15
27
## `cookiePath`
16
28
17
-
TBD
29
+
Specifies the cookie path for the deployment ID cookie associated with the user session. To change the cookie path, use the `cookiePath` option:
30
+
31
+
```ts !#2 skew-protection.ts
32
+
createSkewProtectionFunction("spa", {
33
+
cookiePath: "/my-app"
34
+
});
35
+
```
18
36
19
37
## `cookieMaxAgeInMs`
20
38
21
-
TBD
39
+
Sets the maximum age (in milliseconds) of the cookie holding the deployment ID. To customize the expiration, use the `cookieMaxAgeInMs` option:
40
+
41
+
```ts !#2 skew-protection.ts
42
+
createSkewProtectionFunction("spa", {
43
+
cookieMaxAgeInMs: 1000*60*30*24
44
+
});
45
+
```
46
+
47
+
## `verbose`
22
48
23
-
## `debug`
49
+
Enables additional logging in the [Edge Functions logs](https://docs.netlify.com/edge-functions/get-started/#monitor) to assist with troubleshooting. To enable verbose logging, set the `verbose` option to `true`:
Copy file name to clipboardExpand all lines: docs/getting-started.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ The example above assumes that the application's entry point is `index.html`. If
87
87
88
88
### Register the Edge Function
89
89
90
-
Now, let’s register the Edge Function with Netlify. If the project doesn't already include a `netlify.toml` file, create one at the root of the project:
90
+
Now, let's register the Edge Function with Netlify. If the project doesn't already include a `netlify.toml` file, create one at the root of the project:
91
91
92
92
```!#4
93
93
web-project
@@ -112,7 +112,7 @@ Then, open the `netlify.toml` file and add/replace the following configuration t
112
112
113
113
If your application is deployed using a combination of an Azure DevOps pipeline or a GitHub Action along with the Netlify CLI, you're all set, no additional steps are required to build the Edge Function.
114
114
115
-
However, if your application is built and deployed using [Netlify Continuous Deployment](https://www.netlify.com/blog/enhance-your-development-workflow-with-continuous-deployment), an existing [limitation](https://developers.netlify.com/sdk/edge-functions/get-started#limitations) in Netlify’s Edge Function support for imported NPM packages requires additional steps. In this case, you'll need to explicitly build the Edge Function using [Rslib](https://lib.rsbuild.dev/).
115
+
However, if your application is built and deployed using [Netlify Continuous Deployment](https://www.netlify.com/blog/enhance-your-development-workflow-with-continuous-deployment), an existing [limitation](https://developers.netlify.com/sdk/edge-functions/get-started#limitations) in Netlify's Edge Function support for imported NPM packages requires additional steps. In this case, you'll need to explicitly build the Edge Function using [Rslib](https://lib.rsbuild.dev/).
116
116
117
117
#### Rslib
118
118
@@ -199,7 +199,7 @@ Finally, update the project's `package.json` file to build both, the application
199
199
}
200
200
```
201
201
202
-
#### The esm.sh alternative
202
+
#### esm.sh alternative
203
203
204
204
Using [esm.sh](https://esm.sh/) to import the package is a more straightforward approach, but it introduces an additional third-party dependency. To load the [@workleap/netlify-skew-protection](https://www.npmjs.com/package/@workleap/netlify-skew-protection) package via `esm.sh`, you can use the following import directly in your Edge Function:
205
205
@@ -255,6 +255,6 @@ To verify that Skew Protection is working as expected, follow these steps:
255
255
256
256
- If the logs indicate that the Edge Function isn't installed correctly, it's likely because the `SKEW_PROTECTION_SECRET` environment variable is missing from the Netlify site's configuration.
257
257
258
-
- If requests to previous deploy assets aren't being re-routed as expected, enable the [debug](./available-options.md#debug) option, redeploy the Edge Function, and inspect the [Edge Functions logs](https://docs.netlify.com/edge-functions/get-started/#monitor) for details.
258
+
- If requests to previous deploy assets aren't being re-routed as expected, enable the [verbose](./available-options.md#verbose) option, redeploy the Edge Function, and inspect the [Edge Functions logs](https://docs.netlify.com/edge-functions/get-started/#monitor) for details.
0 commit comments