onairos 0.1.1 → 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.
Files changed (2) hide show
  1. package/README.md +5 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -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
- You should also send the access token as part of this request, from your **backend**
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
- You must also include the Access Token in the request Header
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, accessToken } = 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
- const apiUrl = event.data.APIurl;
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onairos",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "dependencies": {
5
5
  "@testing-library/jest-dom": "^5.17.0",
6
6
  "@testing-library/react": "^13.4.0",