πŸ“©
Fetching Data
Learn how to integrate our system with React Native.
You can easily use echo3D with your React Native project by using our RESTful API.
You can use the fetch interface to query your project data set using the query API call:
app.js
1
...
2
​
3
render: function() {
4
5
var echoDB;
6
7
// Query echo3D
8
fetch('https://api.echo3D.co/query?key=' + API_KEY)
9
.then((response) => response.json())
10
.then((json) => {
11
// Store database
12
global.echoDB = json; // Save JSON response as a global variable
13
})
14
.catch((error) => {
15
console.error(error);
16
});
17
18
...
19
​
20
}
21
​
22
...
Copied!
You will be able to access your API key and database entries anywhere as follows:
1
var apiKey = global.echoDB.apiKey;
2
var db = Object.values(global.echoDB.db);
Copied!
Last modified 17d ago
Copy link