Socket
Socket
Sign inDemoInstall

@8base/app-provider

Package Overview
Dependencies
138
Maintainers
3
Versions
182
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @8base/app-provider

Universal 8base App Provider loads fragments schema and provides it to Apollo client, along with authentication and table schema.


Version published
Weekly downloads
197
increased by3183.33%
Maintainers
3
Install size
29.5 MB
Created
Weekly downloads
 

Readme

Source

8base App Provider

Universal 8base App Provider loads fragments schema and provides it to Apollo client, along with authentication and table schema.

API

Table of Contents

  • EightBaseAppProvider

EightBaseAppProvider

EightBaseAppProvider universal provider which loads fragments schema and provides it to Apollo client, along with authentication and table schema.

Properties

  • uri string? The 8base API field schema.
  • authClient Object? The 8base auth client.
  • onRequestSuccess Function? Callback which is executed when a request is successful.
  • onRequestError Function? Callback which is executed when a request fails.
  • extendLinks Function? Function to extend the standard array of links.
  • children Function? The render function.

Usage

import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import { EightBaseAppProvider } from '@8base/app-provider';
import { WebAuth0AuthClient } from '@8base/web-auth0-auth-client';
import { EightBaseBoostProvider, Loader } from '@8base/boost';

import { Routes } from './routes';

const authClient = new WebAuth0AuthClient({
  domain: AUTH_DOMAIN,
  clientId: AUTH_CLIENT_ID,
  redirectUri: `${window.location.origin}/auth/callback`,
  logoutRedirectUri: `${window.location.origin}/auth`,
  workspaceId: 'workspace-id',
});

const Application = () => (
  <BrowserRouter>
    <EightBaseBoostProvider>
      <EightBaseAppProvider uri={ process.env.REACT_APP_8BASE_API_URL } authClient={ authClient }>
        {
          ({ loading }) => loading ? <Loader /> : <Routes />
        }
      </EightBaseAppProvider>
    </EightBaseBoostProvider>
  </BrowserRouter>
);

export { Application };

FAQs

Last updated on 20 Sep 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc