@claimr/react-native-clientdeprecated

React Native client to integrate with the ClaimR API.

Usage no npm install needed!

<script type="module">
  import claimrReactNativeClient from 'https://cdn.skypack.dev/@claimr/react-native-client';
</script>

README

@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