Giter Site home page Giter Site logo

afterthought / frontegg-react Goto Github PK

View Code? Open in Web Editor NEW

This project forked from frontegg/frontegg-react

0.0 2.0 0.0 19.2 MB

Frontegg-React is pre-built Component for faster and simpler integration with Frontegg services.

Home Page: https://docs.frontegg.com/

License: MIT License

Makefile 0.74% TypeScript 84.52% HTML 0.13% JavaScript 2.85% SCSS 11.72% Shell 0.02% Dockerfile 0.02%

frontegg-react's Introduction

Frontegg React

alt text

Frontegg is a web platform where SaaS companies can set up their fully managed, scalable and brand aware - SaaS features and integrate them into their SaaS portals in up to 5 lines of code.

BREAKING CHANGES SINCE VERSION 3.0.0

The new @frontegg/react uses AdminPortal and LoginBox instead of multiple components.

Installation

Use the package manager npm to install frontegg React.JS library.

npm install @frontegg/react

Configuration

Wrap your application with Frontegg Provider:

import { FronteggProvider } from '@frontegg/react'

const contextOptions = {
  baseUrl: 'https://{HOST}.frontegg.com', // Your backend base URL (frontegg will direct the requests to it)
}

export const App = () => {
  return <FronteggProvider contextOptions={contextOptions}>
    {/*...*/}
  </FronteggProvider>
}

Usage

You can use React Hooks to access Frontegg store.

import { useAuthUser } from '@frontegg/react'

const HomePage = () => {
  const user = useAuthUser();

  return <div>
    Logged In user: {user.email}
  </div>
}

Opening the Admin Portal is available via the following code snippet.

import { AdminPortal } from '@frontegg/react'

const Toolbar = () => {

  return <nav>
    {/*... your application tabs ...*/}

    <button onClick={() => AdminPortal.show()}>
      Open Admin Portal
    </button>
  </nav>
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.