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

@relate/web

Package Overview
Dependencies
Maintainers
3
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@relate/web

Web

  • 1.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
68
increased by61.9%
Maintainers
3
Weekly downloads
 
Created
Source

@relate/web

The Neo4j WEB package.

Table of Content

Installing

Run these commands to install and start the Relate web server.

$ npm install -g @relate/web
$ relate-web start

Note: You need to create and activate an environment before starting the server. Check the install section in the CLI package to learn how to do that.

By default the server will use port 3000, you can change that port with the PORT environment variable. Example:

$ PORT=5000 relate-web start

Documentation

With the server running you can visit the URLs below to access docs for the schema.

Configuration

By default the server configuration is picked up from the active environment.

A different environment can be specified when running the web module in a Nestjs application by using the defaultEnvironmentNameOrId option.

API Tokens

Enabling API tokens

When creating a new environment, by default the web server will not be secured with API tokens. This is useful for development or for learning, but in production environments or when dealing with sensitive data, we strongly recommend you enable API authentication.

To enable authentication through API tokens on a new environment, use the --apiToken flag when creating the environment through the CLI. Example:

$ relate env:init secure-environment --apiToken

To enable authentication on an existing environment, you can open the environment configuration and set the serverConfig.requiresAPIToken field to true. Example:

$ relate env:open secure-environment
{
  "name": "<environmentName>",
  "type": "LOCAL",
  "serverConfig": {
    "publicGraphQLMethods": [...],
    "requiresAPIToken": true
  },
  "id": "<environmentId>",
}

Generating API Tokens

Generated tokens are valid only for a specific client ID and hostname. The client ID is a name identifying your application, while the hostname is the address where your application is running (if it's hosted) or the address to the @relate/web server.

To generate an API token you can either use the CLI or common package:

# @relate/cli
$ relate env:api-token clientId --hostName http://127.0.0.1:3000

# @relate/common
environment.generateAPIToken('http://127.0.0.1:3000', clientId);

Sending Requests

When sending the request, you'll then need to include the following HTTP headers:

X-API-Token: <API Token>
X-Client-Id: <client ID>

FAQs

Package last updated on 23 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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