This package has been deprecated

Author message:

`@claimr/react-native-client` is being renamed to `@unveiler.io/react-native-client`. Please follow the migration instructions in the GitHub release notes.

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

2.1.0 • Public • Published

@claimr/react-native-client

Language grade: JavaScript

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

Installation

Using NPM:

npm install @claimr/react-native-client

Or Yarn:

yarn add @claimr/react-native-client

Usage

import { ClaimrClient, useLazyVerifiedLocation } from '@claimr/react-native-client'
import { Text, Button } from 'react-native'

const client = new ClaimrClient({ 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.claimr.tools.

# 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

Readme

Keywords

Package Sidebar

Install

npm i @claimr/react-native-client

Weekly Downloads

0

Version

2.1.0

License

MIT

Unpacked Size

733 kB

Total Files

90

Last publish

Collaborators

  • addono