Login
Signup
Edgemesh Server
Edgemesh Client
Search…
Introduction
FAQ
Getting Started
Prerequisites
SSL
Edgemesh Portal
Edgemesh Client
Custom
Shopify
SalesForce Commerce Cloud
Magento
Wordpress
BigCommerce
Fastly
Cloudflare
Gatsby
Integrations
Google Analytics
Edgemesh Server
Installation
Dynamic Fragments
Image Optimization
Search Param Directives
Data Attribute Directives
Reference
Client
API
Response Headers
Powered By
GitBook
Gatsby
Installing Edgemesh on a Gatsby JAM Stack.
Create Service Worker
Create a file in the
static
folder of your Gatsby project called
sw.js
and add the following line:
sw.js
1
importScripts
(
'https://static.edgeme.sh/edgemesh-sw.js'
)
Copied!
Add the Edgemesh Plugin
Install the plugin with from
NPM
.
1
$ npm i gatsby-plugin-edgemesh --save
Copied!
Enable the plugin in your
gatsby-config.js
.
gatsby-config.js
1
module
.
exports
=
{
2
plugins
:
[
3
'gatsby-plugin-edgemesh'
4
]
5
}
Copied!
The Gatsby plugin accepts the
same options
as all of the other Edgemesh Clients.
gatsby-config.js
1
module
.
exports
=
{
2
plugins
:
[{
3
resolve
:
'gatsby-plugin-edgemesh'
,
4
options
:
{
5
// Edgemesh Options
6
host
:
API_URL
,
7
swUrl
:
'/sw.js'
,
8
scope
:
'/'
,
9
lite
:
false
,
10
externalMount
:
false
,
11
softDisable
:
false
12
}
13
}]
14
}
Copied!
​
Edgemesh Client - Previous
Cloudflare
Next - Integrations
Google Analytics
Last modified
2yr ago
Copy link
Contents
Create Service Worker
Add the Edgemesh Plugin