You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+86Lines changed: 86 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,9 @@ This document describes the server-side JSON API exposed by the React Native Dir
8
8
-[`POST /api/libraries/check`](#post-apilibrariescheck) - return metadata for a list of npm package names
9
9
-[`GET /api/libraries/statistic`](#get-apilibrariesstatistic) - aggregated statistics about the directory dataset
10
10
-[`GET /api/library`](#get-apilibrary) - lookup one or more libraries by npm package name (optionally `check` existence only)
11
+
-[`GET /api/proxy/github-funding`](#get-apiproxygithub-funding) - proxy to https://api.github.com/graphql API with baked query for fetching funding data
11
12
-[`GET /api/proxy/npm-stat`](#get-apiproxynpm-stat) - proxy to https://npm-stat.com download counts API
13
+
-[`GET /api/proxy/unpkg`](#get-apiproxyunpkg) - proxy to https://unpkg.com/ API with redirect handling on server-side
12
14
13
15
## GET /api/libraries
14
16
@@ -331,6 +333,43 @@ Endpoint can optionally perform a quick `check` to return existence flag only, o
331
333
332
334
---
333
335
336
+
## GET /api/proxy/github-funding
337
+
338
+
Proxy to api.github.com/graphql to fetch project funding data. This endpoint uses baked query, and cannot be used to fetch other data than funding details.
339
+
340
+
- Method: GET
341
+
- Path: `/api/proxy/github-funding`
342
+
- Query parameters:
343
+
-`name` - GitHub repository name (required).
344
+
-`owner` - GitHub repository owner (required).
345
+
346
+
### Notes
347
+
348
+
- It is subject to the same CORS and rate limiting policies as the original api.github.com/graphql.
349
+
350
+
### Example
351
+
352
+
- GET `/api/proxy/github-funding?owner=lodev09&name=react-native-true-sheet`
353
+
354
+
Response:
355
+
356
+
```json
357
+
{
358
+
"fundingLinks": [
359
+
{
360
+
"platform": "GITHUB",
361
+
"url": "https://github.com/lodev09"
362
+
},
363
+
{
364
+
"platform": "BUY_ME_A_COFFEE",
365
+
"url": "https://buymeacoffee.com/lodev09"
366
+
}
367
+
]
368
+
}
369
+
```
370
+
371
+
---
372
+
334
373
## GET /api/proxy/npm-stat
335
374
336
375
Proxy to npm-stat.com to fetch download counts for the last month. This endpoint is a simple proxy and does not perform any data processing.
@@ -386,3 +425,50 @@ Proxy to npm-stat.com to fetch download counts for the last month. This endpoint
386
425
}
387
426
}
388
427
```
428
+
429
+
---
430
+
431
+
## GET /api/proxy/unpkg
432
+
433
+
Proxy to unpkg.com to fetch various package file content.
434
+
435
+
- Method: GET
436
+
- Path: `/api/proxy/unpkg.com`
437
+
- Query parameters:
438
+
-`name` - npm package name (required).
439
+
-`path` - path to wanted file from the bundle (required).
440
+
441
+
### Notes
442
+
443
+
- Redirects returned from unpkg.com are resolve server-side, before returning response.
444
+
- Return will be a plain text if file content is accessible, in any other case (i.e. errors) JSON would be returned.
445
+
446
+
### Example
447
+
448
+
- GET `/api/proxy/unpkg?name=react-native-safe-area-context&path=README.md`
App & Flow is a Montreal-based React Native engineering and consulting studio. We partner with the world’s top companies and are recommended by [Expo](https://expo.dev/consultants). Need a hand? Let’s build together. team@appandflow.com
458
+
459
+
# react-native-safe-area-context
460
+
461
+
[](https://www.npmjs.com/package/react-native-safe-area-context)
0 commit comments