@unveiler.io/react-native-client
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

@unveiler.io/react-native-client

Language grade: JavaScript

A simple, developer friendly library to verify your user's location using the Unveiler verified location API.

Installation

Using NPM:

npm install @unveiler.io/react-native-client

Or Yarn:

yarn add @unveiler.io/react-native-client

Usage

import { UnveilerClient, useLazyVerifiedLocation } from '@unveiler.io/react-native-client'
import { Text, Button } from 'react-native'

const client = new UnveilerClient({ apiKey: 'YOUR_API_KEY' })

const MyModule = () => {
  const { claim, jwt, submit } = useLazyVerifiedLocation({ client })

  return (
    <>
      {submit && <Button onPress={submit} title={'Submit'} />}
      {claim && (
        <Text>
          {claim.location.latitude}, {claim.location.longitude}
        </Text>
      )}
    </>
  )
}

API documentation can be found here.

Example

See an example on how to use this module in examples.

To run it, first create a .env file in the example folder where you add your ClaimR API Key. You can get a key at https://dashboard.unveiler.io.

# Copy the template
cp example/.env.template example/.env

# Open the .env file using your favorite editor
vim example/.env

Then you can start the example app by running:

yarn example android

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

/@unveiler.io/react-native-client/

    Package Sidebar

    Install

    npm i @unveiler.io/react-native-client

    Weekly Downloads

    13

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    7.44 MB

    Total Files

    1410

    Last publish

    Collaborators

    • addono