1.0.0 • Published 6 years ago

react-native-alan-sdk v1.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

Alan SDK React Native

Alan PlatformAlan StudioDocsFAQBlogTwitter

A React Native component for adding a voice experience to your application.

Create a voice script for your application in Alan Studio and then add it to your app.

Getting started

  1. Install npm i alan-sdk-react-native using npm.

  2. Import Alan dependency in your App.js

import AlanButton from './AlanButton.js';
import AlanText from './AlanText.js';
  1. Add Alan view component
 <View style={styles.bottomView}>
          <AlanText style={styles.textView} />
          <AlanButton
            style={styles.buttonView}
            projectid={
              '<YOUR_PROJECT_ID_FROM_ALAN_STUDIO>'
            }
          />
 </View>
  1. Add styles to views
const styles = StyleSheet.create({
  containerMain: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#7ad6f5',
  },
  textView: {
    height: 64,
    right: 20,
    left: 20,
    justifyContent: 'center',
    alignItems: 'center',
    position: 'absolute',
  },
  buttonView: {
    width: 64,
    height: 64,
    right: 20,
    justifyContent: 'center',
    alignItems: 'center',
    position: 'absolute',
  },
  bottomView: {
    width: '100%',
    height: 64,
    bottom: 40,
    justifyContent: 'center',
    alignItems: 'center',
    position: 'absolute',
  },
  textStyle: {
    color: '#fff',
    fontSize: 18,
  },
});

That's it! Now you are ready to interact with Alan!

Documentation

The full API documentation available here.

Learn more about Voice Script Concepts

Have questions?

If you have any questions or if something is missing in the documentation, please contact us, or tweet us @alanvoiceai. We love hearing from you!).