Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sveltejs/adapter-netlify

Package Overview
Dependencies
Maintainers
4
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/adapter-netlify - npm Package Compare versions

Comparing version 1.0.0-next.83 to 1.0.0-next.84

4

package.json
{
"name": "@sveltejs/adapter-netlify",
"version": "1.0.0-next.83",
"version": "1.0.0-next.84",
"repository": {

@@ -35,3 +35,3 @@ "type": "git",

"@rollup/plugin-node-resolve": "^15.0.1",
"@sveltejs/kit": "1.0.0-next.529",
"@sveltejs/kit": "1.0.0-next.533",
"@types/node": "^16.11.68",

@@ -38,0 +38,0 @@ "@types/set-cookie-parser": "^2.4.2",

@@ -53,2 +53,16 @@ # adapter-netlify

```js
import adapter from '@sveltejs/adapter-netlify';
export default {
kit: {
adapter: adapter({
// will create a Netlify Edge Function using Deno-based
// rather than using standard Node-based functions
edge: true
})
}
};
```
## Netlify alternatives to SvelteKit functionality

@@ -73,4 +87,12 @@

With this adapter, SvelteKit endpoints are hosted as [Netlify Functions](https://docs.netlify.com/functions/overview/). Netlify function handlers have additional context, including [Netlify Identity](https://docs.netlify.com/visitor-access/identity/) information. You can access this context via the `event.platform.context` field inside your hooks and endpoints.
With this adapter, SvelteKit endpoints are hosted as [Netlify Functions](https://docs.netlify.com/functions/overview/). Netlify function handlers have additional context, including [Netlify Identity](https://docs.netlify.com/visitor-access/identity/) information. You can access this context via the `event.platform.context` field inside your hooks and `+page.server` or `+layout.server` endpoints. These are [serverless functions](https://docs.netlify.com/functions/overview/) when the `edge` property is `false` in the adapter config or [edge functions](https://docs.netlify.com/edge-functions/overview/#app) when it is `true`.
```js
// +page.server.js
export const load = async (event) => {
const context = event.platform.context;
console.log(context); // shows up in your functions log in the Netlify app
};
```
Additionally, you can add your own Netlify functions by creating a directory for them and adding the configuration to your `netlify.toml` file. For example:

@@ -77,0 +99,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc