• Stars
    star
    457
  • Rank 95,775 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JavaScript client library for GoTrue

gotrue-js library

Build Status

This is a JavaScript client library for the GoTrue API.

It lets you create and authenticate users and is a building block for constructing the UI for signups, password recovery, login and logout.

Play around the methods via the demo site.

Installation

yarn add gotrue-js

Usage

import GoTrue from 'gotrue-js';

// Instantiate the GoTrue auth client with an optional configuration

auth = new GoTrue({
  APIUrl: 'https://<your domain name>/.netlify/identity',
  audience: '',
  setCookie: false,
});

GoTrue configuration

APIUrl: The absolute path of the GoTrue endpoint. To find the APIUrl, go to Identity page of your Netlify site dashboard.

audience(optional): audience is one of the pre-defined JWT payload claims. It's an optional attribute which is set to be empty by default. If you were hosting your own identity service and wanted to support multitenancy, you would need audience to separate the users.

setCookie(optional): set to be false by default. If you wish to implement the remember me functionality, set the value to be true.

Error handling

If an error occurs during the request, the promise may be rejected with an Error, HTTPError, TextHTTPError, or JSONHTTPError. See micro-api-client-lib error types.

Authentication examples

Create a new user

Create a new user with the specified email and password

auth.signup(email, password);

Example usage:

auth
  .signup(email, password)
  .then((response) => console.log('Confirmation email sent', response))
  .catch((error) => console.log("It's an error", error));

Example response object:

{
  "id": "example-id",
  "aud": "",
  "role": "",
  "email": "[email protected]",
  "confirmation_sent_at": "2018-04-27T22:36:59.636416916Z",
  "app_metadata": { "provider": "email" },
  "user_metadata": null,
  "created_at": "2018-04-27T22:36:59.632133283Z",
  "updated_at": "2018-04-27T22:37:00.061039863Z"
}

Also, make sure the Registration preferences under Identity settings in your Netlify dashboard are set to Open.

registration preferences

If the registration preferences is set to be Invite only, you'll get an error message like this: {code: 403, msg: 'Signups not allowed for this instance'}

Confirm a new user signup

This function confirms a user sign up via a unique confirmation token

auth.confirm(token, remember);

When a new user signed up, a confirmation email will be sent to the user if Autoconfirm isn't turned on under the identity settings.

In the email, there's a link that says "Confirm your email address". When a user clicks on the link, it'll be redirected to the site with a fragment identifier #confirmation_token=Iyo9xHvsGVbW-9A9v4sDmQ in the URL.

For all good reasons, the confirmation_token is hidden from the browser via a redirect.

If you wish to manually confirm a user using the auth.confirm(token, remember) method, you can copy the link location of the email and use the curl -I script to get the confirmation_token from your terminal. E.g.,

$ curl -I https://mandrillapp.com/track/click/30002868/example.netlify.com?p=example-token
  HTTP/1.1 302 Moved Temporarily
  Server: nginx/1.12.2
  Date: Tue, 15 May 2018 21:19:13 GMT
  Content-Type: text/html; charset=utf-8
  Set-Cookie: PHPSESSID=77c421bf85fa412e5f994f28a6b30956; expires=Wed, 16-May-2018 07:19:13 GMT; path=/; secure; HttpOnly
  Expires: Thu, 19 Nov 1981 08:52:00 GMT
  Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  Pragma: no-cache
  Set-Cookie: PHPSESSID=77c421bf85fa412e5f994f28a6b30956; expires=Wed, 16-May-2018 07:19:13 GMT; path=/; secure; httponly
  Location: https://example.netlify.com/#confirmation_token=Iyo9xHvsGVbW-9A9v4sDmQ

Example usage:

auth
  .confirm(token, true)
  .then((response) => {
    console.log('Confirmation email sent', JSON.stringify({ response }));
  })
  .catch((error) => {
    console.log(error);
  });

This method requires usage of browser window object localStorage. Test the usage in your front end code.

Example response object:

{
  "response": {
    "api": {
      "apiURL": "https://example.netlify.com/.netlify/identity",
      "_sameOrigin": true,
      "defaultHeaders": {}
    },
    "url": "https://example.netlify.com/.netlify/identity",
    "token": {
      "access_token": "example-jwt-token",
      "token_type": "bearer",
      "expires_in": 3600,
      "refresh_token": "example-refresh_token",
      "expires_at": 1526110512000
    },
    "id": "example-id",
    "aud": "",
    "role": "",
    "email": "[email protected]",
    "confirmed_at": "2018-05-12T06:35:13Z",
    "confirmation_sent_at": "2018-05-12T06:34:35Z",
    "app_metadata": {
      "provider": "email"
    },
    "user_metadata": {},
    "created_at": "2018-05-12T06:34:35Z",
    "updated_at": "2018-05-12T06:34:35Z"
  }
}

Login a user

Handles user login via the specified email and password

auth.login(email, password, remember)

Example usage:

auth
  .login(email.value, password.value, true)
  .then((response) => {
    showMessage(`Success! Response: ${JSON.stringify({ response })}`, form);
  })
  .catch((error) => showMessage(`Failed :( ${JSON.stringify(error)}`, form));

Example response object:

{
  "response": {
    "api": {
      "apiURL": "https://example.netlify.com/.netlify/identity",
      "_sameOrigin": true,
      "defaultHeaders": {}
    },
    "url": "https://example.netlify.com/.netlify/identity",
    "token": {
      "access_token": "example-jwt-token",
      "token_type": "bearer",
      "expires_in": 3600,
      "refresh_token": "example-refresh_token",
      "expires_at": 1526062471000
    },
    "id": "example-id",
    "aud": "",
    "role": "",
    "email": "[email protected]",
    "confirmed_at": "2018-05-04T23:57:17Z",
    "app_metadata": {
      "provider": "email"
    },
    "user_metadata": {},
    "created_at": "2018-05-04T23:57:17Z",
    "updated_at": "2018-05-04T23:57:17Z"
  }
}

Request password recover email

This function sends a request to GoTrue API and triggers a password recovery email to the specified email address. Similar to confirmation_token, the recovery_token is baked in the link of the email. You can also copy the link location from the email and run curl -I in the command line to grab the token.

auth.requestPasswordRecovery(email)

Example usage:

auth
  .requestPasswordRecovery(email)
  .then((response) => console.log('Recovery email sent', { response }))
  .catch((error) => console.log('Error sending recovery mail: %o', error));

Example response object: {}

Recover a user account

This function recovers a user account via a recovery token

auth.recover(recoveryToken, remember)

Example usage:

auth
  .recover(token, true)
  .then((response) => console.log('Logged in as %s', JSON.stringify({ response })))
  .catch((error) => console.log('Failed to verify recover token: %o', error));

Example response object:

{
  "response": {
    "api": {
      "apiURL": "https://example.netlify.com/.netlify/identity",
      "_sameOrigin": true,
      "defaultHeaders": {}
    },
    "url": "https://example.netlify.com/.netlify/identity",
    "token": {
      "access_token": "example-jwt-token",
      "token_type": "bearer",
      "expires_in": 3600,
      "refresh_token": "example-refresh_token",
      "expires_at": 1526107729000
    },
    "id": "example-id",
    "aud": "",
    "role": "",
    "email": "[email protected]",
    "confirmed_at": "2018-05-12T05:48:49Z",
    "invited_at": "2018-05-04T23:40:00Z",
    "recovery_sent_at": "2018-05-12T05:48:13Z",
    "app_metadata": {
      "provider": "email"
    },
    "user_metadata": {},
    "created_at": "2018-05-04T23:40:00Z",
    "updated_at": "2018-05-04T23:40:00Z"
  }
}

Get current user

This function returns the current user object when a user is logged in

auth.currentUser()

Example usage:

const user = auth.currentUser();

Example response object:

{
  "api": {
    "apiURL": "https://example.netlify.com/.netlify/identity",
    "_sameOrigin": true,
    "defaultHeaders": {}
  },
  "url": "https://example.netlify.com/.netlify/identity",
  "token": {
    "access_token": "example-jwt-token",
    "token_type": "bearer",
    "expires_in": 3600,
    "refresh_token": "example-refresh_token",
    "expires_at": 1525214326000
  },
  "id": "example-id",
  "aud": "",
  "role": "",
  "email": "[email protected]",
  "confirmed_at": "2018-05-01T19:21:00Z",
  "app_metadata": {
    "provider": "email"
  },
  "user_metadata": {},
  "created_at": "2018-05-01T19:21:00Z",
  "updated_at": "2018-05-01T19:21:00Z"
}

Update a user

This function updates a user object with specified attributes

user.update(attributes)

Users can update their user_metadata field. To do this, pass an object to the attributes.data key with the fields you want to update. Updates to a users app_metadata must be performed from a secure environment, such as a Lambda function. For examples on updating user and app metadata, see netlify/identity-update-user-data.

Example usage:

const user = auth.currentUser();

user
  .update({ email: '[email protected]', password: 'password' })
  .then((user) => console.log('Updated user %s', user))
  .catch((error) => {
    console.log('Failed to update user: %o', error);
    throw error;
  });

Example response object:

{
  "api": {
    "apiURL": "https://example.netlify.com/.netlify/identity",
    "_sameOrigin": true,
    "defaultHeaders": {}
  },
  "url": "https://example.netlify.com/.netlify/identity",
  "token": {
    "access_token": "example-jwt-token",
    "token_type": "bearer",
    "expires_in": 3600,
    "refresh_token": "example-refresh_token",
    "expires_at": 1525215471000
  },
  "id": "example-id",
  "aud": "",
  "role": "",
  "email": "[email protected]",
  "confirmed_at": "2018-05-01T19:21:00Z",
  "app_metadata": {
    "provider": "email"
  },
  "user_metadata": {},
  "created_at": "2018-05-01T19:21:00Z",
  "updated_at": "2018-05-01T22:04:07.923944421Z",
  "new_email": "[email protected]",
  "email_change_sent_at": "2018-05-01T22:04:07.49197052Z"
}

Get a JWT token

This function retrieves a JWT token from a currently logged in user

user.jwt(forceRefresh)

Example usage:

const user = auth.currentUser();
const jwt = user.jwt();
jwt
  .then((response) => console.log('This is a JWT token', response))
  .catch((error) => {
    console.log('Error fetching JWT token', error);
    throw error;
  });

Example response object:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1MjUyMTk4MTYsInN1YiI6ImE5NG.98YDkB6B9JbBlDlqqef2nme2tkAnsi30QVys9aevdCw debugger eval code:1:43

Logout a user

This function removes the current session of the user and log out the user

user.logout()

Example usage:

const user = auth.currentUser();
user
  .logout()
  .then(response => console.log("User logged out");)
  .catch(error => {
    console.log("Failed to logout user: %o", error);
    throw error;
  });

Admin methods

The following admin methods are currently not available to be used directly. You can access context.clientContext.identity and get a short lived admin token through a Lambda function and achieve the same goals, e.g., update user role, create or delete user etc. See Functions and Identity for more info.

For users of Netlify CLI - functions using admin methods will not work locally - they need to be deployed to your site in order to work as intended.

Let's create a simple login form in HTML and JavaScript to interact with a lambda function and test out the admin methods.

  1. Create an HTML form for user login
<h2>Log in</h2>
<form name="login">
  <div class="message"></div>
  <p>
    <label>Email<br /><input type="email" name="email" required /></label>
  </p>
  <p>
    <label>Password<br /><input type="password" name="password" required /></label>
  </p>
  <button type="submit">Log in</button>
</form>
  1. Invoke lambda function. (In this example our function is names as hello.js)
document.querySelector("form[name='login']").addEventListener("submit", e => {
  e.preventDefault();
  const form = e.target;
  const { email, password } = form.elements;
  auth
    .login(email.value, password.value, true)
    .then(response => {
      const myAuthHeader = "Bearer " + response.token.access_token; //creates the bearer token
      fetch("/.netlify/functions/hello", {
        headers: { Authorization: myAuthHeader },
        credentials: "include"
      })
        .then(response => {
          console.log({ response });
        })
        .catch(error => {...});
    })
    .catch(error => {...});
});

Get a user

This function retrieves a user object with the specified user id

getUser(user) {
    return this.user.\_request(`/admin/users/${user.id}`);
}

Example usage:

import fetch from 'node-fetch';

exports.handler = async (event, context) => {
  const { identity, user } = context.clientContext;
  const userID = user.sub;
  const userUrl = `${identity.url}/admin/users/{${userID}}`;
  const adminAuthHeader = `Bearer ${  identity.token}`;

  try {
    return fetch(userUrl, {
      method: 'GET',
      headers: { Authorization: adminAuthHeader },
    })
      .then((response) => response.json())
      .then((data) => {
        console.log('data', JSON.stringify(data));
        return { statusCode: 204 };
      })
      .catch((error) => {
        console.log('Failed to get user! 500! Internal.');
        return {
          statusCode: 500,
          body: `Internal Server Error: ${  error}`,
        };
      });
  } catch (error) {
    console.log('GOT HERE! 500! outer');
    return { statusCode: 500, body: `Internal Server Error: ${  error}` };
  }
};

Example response object:

{
  "id": "example-id",
  "aud": "",
  "role": "",
  "email": "[email protected]",
  "confirmed_at": "2018-05-09T06:28:46Z",
  "app_metadata": {
    "provider": "email"
  },
  "user_metadata": {},
  "created_at": "2018-05-09T06:28:46Z",
  "updated_at": "2018-05-09T06:28:46Z"
}

Update a user

This function updates the an existing user with the specified attributes

updateUser(user, attributes = {}) {
   return this.user._request(`/admin/users/${user.id}`, {
     method: "PUT",
     body: JSON.stringify(attributes)
   });
}

Example usage:

import fetch from "node-fetch";

exports.handler = async (event, context) => {
  const { identity, user } = context.clientContext;
  const userID = user.sub;
  const userUrl = `${identity.url}/admin/users/${userID}`;
  const adminAuthHeader = "Bearer " + identity.token;

  try {
    return fetch(userUrl, {
      method: "PUT",
      headers: { Authorization: adminAuthHeader },
      body: JSON.stringify({ app_metadata: { roles: ["superstar"] } })
    })
      .then(response => {
        return response.json();
      })
      .then(data => {
        console.log("Updated a user! 204!");
        console.log(JSON.stringify({ data }));
        return { statusCode: 204 };
      })
      .catch(e => return {...});
  } catch (e) { return e; }
};

Example response object:

{
  "data": {
    "id": "example-id",
    "aud": "",
    "role": "",
    "email": "[email protected]",
    "confirmed_at": "2018-05-09T06:52:58Z",
    "app_metadata": {
      "provider": "email",
      "roles": [
        "superstar"
      ]
    },
    "user_metadata": {},
    "created_at": "2018-05-09T06:52:58Z",
    "updated_at": "2018-05-11T00:26:27.668465915Z"
  }
}

Invite a user

To invite a user using the admin token, do a POST request to /invite endpoint. It's not possible to set user_metadata or app_metadata until a user has been created.

Example usage:

import fetch from 'node-fetch';

exports.handler = async (event, context) => {
  const { identity } = context.clientContext;
  const inviteUrl = `${identity.url}/invite`;
  const adminAuthHeader = "Bearer " + identity.token;

    try {
      return fetch(inviteUrl, {
        method: "POST",
        headers: { Authorization: adminAuthHeader },
        body: JSON.stringify({ email: "[email protected]" })
      })
      .then(response => {
        return response.json();
      })
      .then(data => {
        console.log("Invited a user! 204!");
        console.log(JSON.stringify({ data }));
        return { statusCode: 204 };
      })
      .catch(e => return {...});
  } catch (e) { return e; };
};

Example response:

{
  "id": "example-id",
  "aud": "",
  "role": "",
  "email": "[email protected]",
  "invited_at": "2018-05-25T20:28:04.436230023Z",
  "app_metadata": {
    "provider": "email"
  },
  "user_metadata": null,
  "created_at": "2018-05-25T20:28:03.684905861Z",
  "updated_at": "2018-05-25T20:28:04.862592451Z"
}

Create a new user

This function creates a new user object with the specified new email and password and other optional attributes. User will not be confirmed unless confirm parameter is set to true.

createUser(email, password, attributes = {}) {
    attributes.email = email;
    attributes.password = password;
    return this.user.\_request("/admin/users", {
    method: "POST",
    body: JSON.stringify(attributes)
    });
  }

Example usage:

import fetch from "node-fetch";

exports.handler = async (event, context) => {
  const { identity, user } = context.clientContext;
  const userID = user.sub;
  const usersUrl = `${identity.url}/admin/users`;
  const adminAuthHeader = "Bearer " + identity.token;

  try {
    return fetch(usersUrl, {
      method: "POST",
      headers: { Authorization: adminAuthHeader },
      body: JSON.stringify({ email: "[email protected]", password: "newpw", confirm: true })
    })
      .then(response => {
        return response.json();
      })
      .then(data => {
        console.log("Created a user! 204!");
        console.log(JSON.stringify({ data }));
        return { statusCode: 204 };
      })
      .catch(e => {...};
      });
  } catch (e) {
    return e;
  }
};

Example response object:

{
  "data": {
    "id": "new-id",
    "aud": "",
    "role": "",
    "email": "[email protected]",
    "app_metadata": {
      "provider": "email"
    },
    "user_metadata": null,
    "created_at": "2018-05-11T00:37:34.475713996Z",
    "updated_at": "2018-05-11T00:37:34.481743781Z"
  }
}

Delete a user

This function deletes an existing user object

deleteUser(user) {
  return this.user.\_request(`/admin/users/${user.id}`, {
  method: "DELETE"
  });
}

Example usage:

import fetch from 'node-fetch';

exports.handler = async (event, context) => {
  const { identity, user } = context.clientContext;
  const userID = user.sub;
  const userUrl = `${identity.url}/admin/users/{${userID}}`;
  const adminAuthHeader = `Bearer ${identity.token}`;

  try {
    return fetch(userUrl, {
      method: 'DELETE',
      headers: { Authorization: adminAuthHeader },
    })
      .then((response) => {
        console.log('Deleted a user!');
        return response.json();
      })
      .then((data) => {
        console.log({ data });
        return { statusCode: 204 };
      })
      .catch((error) => ({
          statusCode: 500,
          body: `Internal Server Error: ${error}`,
        }));
  } catch (error) {
    return error;
  }
};

Example response object:

{ "data": {} }

Get a list of users

This function retrieves an array of user objects. The audience param is optional. It's for when you are hosting your own identity service and want to support multitenancy.

listUsers(aud) {
    return this.user._request("/admin/users", {
      method: "GET",
      audience: aud
    });
}

Example usage:

import fetch from 'node-fetch';

exports.handler = async (event, context) => {
  const { identity, user } = context.clientContext;
  const usersUrl = `${identity.url}/admin/users`;
  const adminAuthHeader = `Bearer ${identity.token}`;

  try {
    return fetch(usersUrl, {
      method: 'GET',
      headers: { Authorization: adminAuthHeader },
    })
      .then((response) => response.json())
      .then((data) => {
        console.log('data', JSON.stringify(data));
        return { statusCode: 204 };
      })
      .catch((error) => ({
          statusCode: 500,
          body: `Internal Server Error: ${error}`,
        }));
  } catch (error) {
    return error;
  }
};

Example response object:

{
  "aud": "",
  "users": [
    {
      "id": "example-id-01",
      "aud": "",
      "role": "",
      "email": "[email protected]",
      "app_metadata": {
        "provider": "email"
      },
      "user_metadata": {},
      "created_at": "2018-05-09T18:14:51Z",
      "updated_at": "2018-05-09T18:14:51Z"
    },
    {
      "id": "example-id-02",
      "aud": "",
      "role": "",
      "email": "[email protected]",
      "confirmed_at": "2018-05-09T06:52:58Z",
      "app_metadata": {
        "provider": "email"
      },
      "user_metadata": {},
      "created_at": "2018-05-09T06:52:58Z",
      "updated_at": "2018-05-09T06:52:58Z"
    },
    {
      "id": "example-id-03",
      "aud": "",
      "role": "",
      "email": "[email protected]",
      "confirmed_at": "2018-05-09T06:28:46Z",
      "app_metadata": {
        "provider": "email",
        "roles": [
          "admin"
        ]
      },
      "user_metadata": {},
      "created_at": "2018-05-09T06:28:46Z",
      "updated_at": "2018-05-09T06:28:46Z"
    }
  ]
}

Oauth providers supported by Netlify

Currently we support Google, GitHub, GitLab, and BitBucket as directly supported in the Netlify app UI (other oauth providers require serverless functions to be set up correctly, but these don't.)

acceptInviteExternalUrl and loginExternalUrl are useful for that. You can see example usage in netlify-identity-widget

See also

More Repositories

1

netlify-cms

A Git-based CMS for Static Site Generators
JavaScript
16,192
star
2

gotrue

An SWT based API for managing users and issuing SWT tokens.
Go
3,530
star
3

staticgen

StaticGen.com, A leaderboard of top open-source static site generators
JavaScript
2,471
star
4

cli

Netlify Command Line Interface
TypeScript
1,576
star
5

gocommerce

A headless e-commerce for JAMstack sites.
Go
1,465
star
6

netlify-identity-widget

A zero config, framework free Netlify Identity widget
JavaScript
735
star
7

next-on-netlify

Build and deploy Next.js applications with Server-Side Rendering on Netlify!
JavaScript
720
star
8

headlesscms.org

Source for headlesscms.org
JavaScript
628
star
9

netlify-lambda

Helps building and serving lambda functions locally and in CI environments
JavaScript
601
star
10

next-runtime

The Next.js Runtime allows Next.js to run on Netlify with zero configuration
TypeScript
575
star
11

functions.netlify.com

Tutorials, examples, workshops and a playground for serverless with Netlify Functions
SCSS
515
star
12

build-image

This is the build image used for running automated builds
Shell
498
star
13

create-react-app-lambda

JavaScript
414
star
14

netlify-faunadb-example

Using FaunaDB with netlify functions
JavaScript
388
star
15

actions

Shell
360
star
16

git-gateway

A Gateway to Git APIs
Go
355
star
17

zip-it-and-ship-it

Intelligently prepare Node.js Lambda functions for deployment
JavaScript
305
star
18

gotell

Netlify Comments is an API and build tool for handling large amounts of comments for JAMstack products
Go
276
star
19

explorers

JavaScript
262
star
20

million-devs

Microsite for the 1 Million Developers announcement.
Vue
250
star
21

netlify-statuskit

Netlify StatusKit is a template to deploy your own Status pages on Netlify.
HTML
237
star
22

open-api

Open API specification of Netlify's API
Go
234
star
23

build

Netlify Build (node process) runs the build command, Build Plugins and bundles Netlify Functions. Can be run in Buildbot or locally using Netlify CLI
JavaScript
216
star
24

js-client

A Open-API derived JS + Node.js API client for Netlify
JavaScript
214
star
25

netlify-plugin-lighthouse

Netlify Plugin to run Lighthouse on each build
JavaScript
198
star
26

netlifyctl

Go
178
star
27

netlify-dev-plugin

Local dev server with functions, rules engine and add-on support
JavaScript
176
star
28

framework-info

Framework detection utility
JavaScript
137
star
29

jekyll-srcset

Dead simple responsive images for jekyll
Ruby
136
star
30

gocommerce-js

A gocommerce client library
JavaScript
130
star
31

jekyll-gdrive

Access a Google Drive Spreadsheet from your Jekyll templates
Ruby
116
star
32

plugins

Netlify plugins directory.
JavaScript
95
star
33

prerender

Automatically rendering JS-driven pages for crawlers and social sharing
JavaScript
94
star
34

netlify-playground

89
star
35

netlify-plugin-gatsby

A build plugin to integrate Gatsby seamlessly with Netlify
TypeScript
88
star
36

code-examples

Code snippets for customers
HTML
87
star
37

labs

Documentation and samples for Netlify Labs features.
76
star
38

templates

This is board to showcase templates and boilerplates https://templates.netlify.com
Nunjucks
76
star
39

vue-cli-plugin-netlify-lambda

Netlify Lambda plugin for Vue CLI
JavaScript
76
star
40

remix-template

Deploy your Remix site to Netlify Edge Functions
JavaScript
73
star
41

netlify-cms-widget-starter

A boilerplate for creating Netlify CMS widgets.
JavaScript
73
star
42

classnames-template-literals

Small utility to format long classnames with template literals
JavaScript
70
star
43

edge-functions-examples

Explore a library of reference examples for learning about Edge Functions on Netlify.
JavaScript
70
star
44

gotiator

A tiny JWT based API gateway
Go
70
star
45

matterday.netlify.com

A site that asks us what we could do with more time.
CSS
70
star
46

react-server-components-demo

Minimal implementation on server components via Netlify functions
JavaScript
67
star
47

binrc

Binrc is a command line application to manage different versions of binaries stored on GitHub releases.
Makefile
52
star
48

next-on-netlify-demo

Demo of a Next.js app with Server-Side Rendering on Netlify
JavaScript
52
star
49

go-functions-example

Go
49
star
50

petsofnetlify

pets of netlifiers
Nunjucks
47
star
51

full-react-server-demo

JavaScript
45
star
52

rust-functions-example

Deploy Rust lambda functions on Netlify
Rust
45
star
53

gojoin

Mini API wrapping Stripes Subscriptions for Single Page Aps and JAMstack sites
Go
41
star
54

netlify-git-api

Go
41
star
55

gatsby-parallel-runner

JavaScript
38
star
56

functions

JavaScript and TypeScript utilities for Netlify Functions.
TypeScript
38
star
57

elastinats

Go
36
star
58

netlify-photo-gallery

HTML
35
star
59

gocommerce-admin

Admin UI for Netlify Commerce
JavaScript
35
star
60

addons

Netlify add-on documentation
34
star
61

ask-netlify

A place to submit questions for Netlify to answer in tutorials, podcasts and blog posts
HTML
34
star
62

netlify-auth-demo

Demo for integrating GitHub OAuth with a Netlify site
HTML
33
star
63

explorers-up-and-running-with-serverless-functions

Free resource for learning how to use serverless functions!
HTML
31
star
64

hydrogen-netlify-starter

Get started with Hydrogen on Netlify
JavaScript
31
star
65

build-plugin-template

Template repository to create new Netlify Build plugins.
JavaScript
30
star
66

twickr

Twickr lets you send tweets of interest from Twitter to Slack
Go
30
star
67

next-edge-middleware

JavaScript
29
star
68

remix-compute

Remix adapter and server runtime for Netlify
TypeScript
29
star
69

www-post-scheduler

This is a serverless function to auto publish blog posts
JavaScript
28
star
70

postcss-fout-with-a-class

Rewrite all selectors that will trigger a font load to be scoped under a class
JavaScript
28
star
71

micro-api-client

Small library for talking to micro REST APIs (not related to Netlify's main API)
JavaScript
28
star
72

vue-lambda-starter

Starter Template for Vue + AWS Lambda with Netlify
Vue
27
star
73

netlify-browser-extension

netlify-chrome-extension
JavaScript
26
star
74

make-wp-epic

Migration tool for moving from WordPress to Victor Hugo
JavaScript
26
star
75

hydrogen-platform

Hydrogen support for Netlify Edge Functions
TypeScript
26
star
76

netlify-redirect-parser

Library for parsing Netlify redirects
JavaScript
23
star
77

next-react-server-components

JavaScript
22
star
78

netlify-auth-providers

JS library to use Netlify's OAuth providers
JavaScript
22
star
79

explorers-composition-api

Learn how the Composition API works in this Jamstack Explorers mission!
Vue
20
star
80

vite-plugin-netlify-edge

Netlify Edge Function support for Vite
TypeScript
19
star
81

angular-runtime

The Angular Runtime allows Angular to run on Netlify with zero configuration
JavaScript
18
star
82

mailme

MailMe sends mails with stylish templates
Go
18
star
83

eslint-config-node

ESLint, Prettier and Editorconfig shared by Netlify's Node.js projects
JavaScript
18
star
84

slate-markdown-serializer

JavaScript
17
star
85

delta-action

A GitHub Action for capturing benchmark data and tracking its variation against a baseline
JavaScript
17
star
86

netlify-credential-helper

Git credential helper to use Netlify's API as authentication backend
Go
16
star
87

blobs

A TypeScript client for Netlify Blobs
TypeScript
16
star
88

netlify-cms-www

Former repo for netlifycms.org. Moved to the code repo at
CSS
15
star
89

go-client

Depreciated repo: home of the old go client. See netlify/open-api for the new home of the go client
Go
15
star
90

verify-okta

Small Lambda function for verifying and gating content with Okta
Go
14
star
91

netlify-oauth-example

JavaScript
14
star
92

godoc-static

Generates static HTML of documentation of Go libraries
Go
13
star
93

fauna-one-click

Moved https://github.com/netlify/netlify-faunadb-example
JavaScript
13
star
94

screenshot

Take screenshots of websites
Shell
13
star
95

netlify-comments-starter

Start project for Netlify Comments
13
star
96

node-template

Netlify's Node.js repository template
Python
13
star
97

streamer

tail files and send them to nats
Go
12
star
98

edge-bundler

Intelligently prepare Netlify Edge Functions for deployment
TypeScript
12
star
99

ruby-client

Netlify API client for Ruby
Ruby
11
star
100

gatsby-plugin-netlify

Gatsby plugin. Automatically generates a _headers file and a _redirects file at the root of the public folder to configure HTTP headers and redirects on Netlify.
TypeScript
11
star