npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-amphora

v1.9.1-1

Published

React Components for Amphora Data

Readme

react-amphora

React Components for Amphora Data

NPM JavaScript Style Guide Node.js Package

Examples

You can see the example application here

The application deployed there is under /example in this repo.

Install

With NPM

npm install --save react-amphora

or with Yarn

yarn add react-amphora

Usage

import * as React from 'react'
import ReactDOM from 'react-dom'
import { AmphoraProvider, createUserManager } from 'react-amphora'
import { Configuration } from 'amphoradata'

// your application
import App from './App'

// make sure to import the css
import 'react-amphora/dist/index.css'

const userManager = createUserManager({
    clientId: 'your-client-id',
    redirectUri: 'http://localhost:3000/#/callback'
})

const initalConfiguration = new Configuration()

ReactDOM.render(
    <AmphoraProvider
        userManager={userManager}
        configuration={initalConfiguration}
    >
        <App />
    </AmphoraProvider>,
    document.getElementById('root')
)

OAuth Callback

To login with Amphora, you need to be able to handle the OAuth callback to your application. react-amphora provides a component to handle this for you. When the callpath path is requested (e.g. /#/callback/ ) you can render the component.

import * as React from 'react'
import { CallbackPage } from 'react-amphora'
import { userManager } from './userManager'

const App = (props: AppProps) => {
    if (props.location.hash.substring(0, 10) === '#/callback') {
        const rest = props.location.hash.substring(10)
        return (
            <CallbackPage
                onSignIn={props.history.push('/')}
                {...props}
                userManager={userManager}
                signInParams={`${rest}`}
            />
        )
    }
    return (
        <React.Fragment>
            <YourApplicationComponents />
        </React.Fragment>
    )
}

Themes

react-amphora uses Styled Components to apply CSS to components. You can apply your own global themes by introducing your own ThemeProvider, or by passing a theme object into the AmphoraProvider

import { AmphoraProvider, Theme } from 'react-amphora'
const myTheme: Theme = {
    colors: {
        highlight: 'red',
        main: 'blue',
        secondary: 'green'
    }
}

return (
    <AmphoraProvider theme={myTheme}>
        <App />
    </AmphoraProvider>
)

Events

Callbacks are provided for you to response to API events. Pass a callback function into the provider to listen to actions (from the app) and action results (from the server)

import { AmphoraProvider, Actions } from 'react-amphora'
const logAction = (action: Actions.Action) => {
    console.log(action.type)
}
const logActionResult = (actionResult: Actions.ActionResult) => {
    console.log(actionResult.type)
}
return (
    <AmphoraProvider onAction={logAction} onActionResult={logActionResult}>
        <App />
    </AmphoraProvider>
)

Styling

react-amphora uses Styled Components. It is included as a dependency.

NOTE: if you have trouble with styled components and react-native, you may need to incude a .yarnclean file in the root of your project.

.yarnclean

@types/react-native

How it works

IdentityContextProvider

Identity Context Provider uses the React Context API to wrap the OAUTH and OIDC functionality of Amphora Data. Basically, it allows your users to login to your app with their Amphora Data account.

AmphoraApiProvider

Amphora API Provider also uses the React Context API. This time the Amphora Data Javascript SDK is wrapped in a provider. The API provider must be the child of an Identity Context provider.

Releasing

When you want to release a new pre-release version, just run these commands:

yarn version --prerelease
git push

and a new version with be published to NPM

License

MIT © xtellurian