onairos 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ For example:
|
|
|
75
75
|
``` jsx
|
|
76
76
|
export default async function UseAPIURL(event){
|
|
77
77
|
if (event.data && event.data.source === 'content-script' && event.data.type === 'API_URL_RESPONSE') {
|
|
78
|
-
const { APIurl } = event.data;
|
|
78
|
+
const { APIurl, accessToken } = event.data;
|
|
79
79
|
//Fetch Onairos Data from Returned API url
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -99,8 +99,7 @@ Send a POST request to the API endpoint with a JSON payload containing a set of
|
|
|
99
99
|
- `category`: The category to which the content belongs (String) - required
|
|
100
100
|
- `img_url`: The URL of an image associated with the content (String) - optional
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
- `access_token` - App Assigned Access Token - String
|
|
102
|
+
|
|
104
103
|
Example JSON body for the POST request:
|
|
105
104
|
|
|
106
105
|
```json
|
|
@@ -121,7 +120,6 @@ Example JSON body for the POST request:
|
|
|
121
120
|
"category": "Example Category 3",
|
|
122
121
|
"img_url": "http://example.com/image3.jpg"
|
|
123
122
|
},
|
|
124
|
-
"AccessToken":"access_token"
|
|
125
123
|
}
|
|
126
124
|
// Additional entries can be added here
|
|
127
125
|
|
|
@@ -129,12 +127,13 @@ Example JSON body for the POST request:
|
|
|
129
127
|
```
|
|
130
128
|
|
|
131
129
|
You can then call the Inference API with the Inference object created above.
|
|
132
|
-
|
|
130
|
+
Remember to include the access token in the Authorization header of your API request.
|
|
131
|
+
|
|
133
132
|
|
|
134
133
|
```jsx
|
|
135
134
|
export default async function UseAPIURL(event){
|
|
136
135
|
if (event.data && event.data.source === 'content-script' && event.data.type === 'API_URL_RESPONSE') {
|
|
137
|
-
const apiUrl = event.data
|
|
136
|
+
const { apiUrl, accessToken } = event.data;
|
|
138
137
|
await fetch(apiUrl, {
|
|
139
138
|
method: 'POST',
|
|
140
139
|
headers: {
|
|
@@ -188,7 +187,7 @@ function App() {
|
|
|
188
187
|
|
|
189
188
|
async function UseAPIURL(event){
|
|
190
189
|
if (event.data && event.data.source === 'content-script' && event.data.type === 'API_URL_RESPONSE') {
|
|
191
|
-
|
|
190
|
+
const { apiUrl, accessToken } = event.data;
|
|
192
191
|
await fetch(apiUrl, {
|
|
193
192
|
method: 'POST',
|
|
194
193
|
headers: {
|
|
@@ -219,7 +218,6 @@ function App() {
|
|
|
219
218
|
descriptions:"Insight into your Interests",
|
|
220
219
|
reward:"2 USDC"
|
|
221
220
|
},
|
|
222
|
-
AccessToken:access_token
|
|
223
221
|
};
|
|
224
222
|
useEffect(() => {
|
|
225
223
|
window.addEventListener('message', UseAPIURL);
|