Skip to content

Commit

Permalink
Setup for env for Clarifai API
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaminus committed Mar 4, 2018
1 parent 167af54 commit 8f2ea15
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["react-native"]
"presets": ["react-native", "react-native-dotenv"]
}
1 change: 1 addition & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CLARIFAY_KEY=api_key
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ build/
local.properties
*.iml

# env files
.env
.env.prod

# node.js
#
node_modules/
Expand All @@ -51,3 +55,5 @@ buck-out/
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

.vscode/
24 changes: 24 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"babel-jest": "22.4.0",
"babel-preset-react-native": "4.0.0",
"jest": "22.4.0",
"react-native-dotenv": "^0.1.1",
"react-test-renderer": "16.2.0"
},
"jest": {
Expand Down
4 changes: 3 additions & 1 deletion src/screens/Predict/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { Button, Text } from "react-native-elements";

import Clarifai from "clarifai";

import { CLARIFAY_KEY } from 'react-native-dotenv';

import Notif from "../../components/Notif";

import styles from "./styles";
Expand All @@ -30,7 +32,7 @@ class Predict extends Component {

componentDidMount() {
const clarifai = new Clarifai.App({
apiKey: "" //dummy
apiKey: CLARIFAY_KEY //dummy
});

process.nextTick = setImmediate; // RN polyfill
Expand Down

0 comments on commit 8f2ea15

Please sign in to comment.