1.0.0 • Published 6 years ago
react-native-alan-sdk v1.0.0
Alan SDK React Native
Alan Platform • Alan Studio • Docs • FAQ • Blog • Twitter
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
Install
npm i alan-sdk-react-native
using npm.Import Alan dependency in your
App.js
import AlanButton from './AlanButton.js';
import AlanText from './AlanText.js';
- Add Alan view component
<View style={styles.bottomView}>
<AlanText style={styles.textView} />
<AlanButton
style={styles.buttonView}
projectid={
'<YOUR_PROJECT_ID_FROM_ALAN_STUDIO>'
}
/>
</View>
- 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!).
1.0.0
6 years ago