1.1.0 • Published 10 months ago

@plaude/react-native v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Getting started

First, install the Plaude SDK.

npm install @plaude/react-native

Then, add the following environment variable from your Plaude dashboard.

PLAUDE_APP_ID="This is an example"

Then, wrap your application with the PlaudeProvider component.

import { PlaudeProvider } from '@plaude/react-native';

export default function RootLayout({ children }: React.PropsWithChildren) {
  return <PlaudeProvider>{children}</PlaudeProvider>;
}

Although Plaude automatically gets the App ID from your environment, you can opt for manually setting it in the PlaudeProvider component.

import { PlaudeProvider } from '@plaude/react-native';

export default function RootLayout({ children }: React.PropsWithChildren) {
  return <PlaudeProvider appId="Your App ID">{children}</PlaudeProvider>;
}

At this point the installation is completed, you can make use of the Plaude messenger by calling the openMessenger() method from the usePlaude() hook.

import { Pressable, Text, View } from 'react-native';
import { usePlaude } from '@plaude/react-native';

export default function Page() {
  const { openMessenger } = usePlaude();

  return (
    <View>
      <Pressable onPress={openMessenger}>
        <Text>Open Plaude</Text>
      </Pressable>
    </View>
  );
}
1.1.0

10 months ago

1.0.5

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

0.0.2

10 months ago