Back to Electric

Netlify - Integrations

website/docs/integrations/netlify.md

latest1.6 KB
Original Source
<script setup> import DeployToNetlifyForm from '/src/components/DeployToNetlifyForm.vue' </script>

Netlify

Netlify is an application deployment platform.

Electric and Netlify

Netlify is a great choice for deploying client-side web apps that use Electric.

[!Tip] Need context? See the Deployment guide for more details.

Deploy your app

Create your app, connect it to Netlify and deploy via git push.

Connect to Electric

[!Warning] You need Electric (and Postgres) running somewhere else The easiest way is to use the Electric Cloud. Or see the Deployment guide.

Copy the URL to your Electric instance and use it when syncing data into your app. E.g.: by setting an environment variable and using it in your code:

tsx
const ELECTRIC_URL = process.env.ELECTRIC_URL

const stream = new ShapeStream({
  url: `${ELECTRIC_URL}/v1/shape`,
  params: {
    table: 'items',
  },
})

See the Client docs for more information.

Example

Deploy example app

Deploy our standalone-basic-example app using the form below:

<DeployToNetlifyForm repo="electric-sql/standalone-basic-example" />