File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ edition = "2024"
5
5
6
6
[dependencies ]
7
7
octocrab = { version = " 0.45.0" , default-features = false }
8
+
9
+ [target .'cfg(target_arch = "wasm32")' .dependencies ]
8
10
http-body = " 1.0.1"
9
11
tower = " 0.5.2"
10
12
http = " 1.3.1"
Original file line number Diff line number Diff line change 2
2
3
3
This is a thin wrapper around [ octocrab] ( https://crates.io/crates/octocrab ) that
4
4
adds support for using octocrab in wasm based on reqwest.
5
+
6
+ ### Usage
7
+
8
+ This crate exports a builder that works natively and in wasm:
9
+ ``` rust
10
+ let mut client = octocrab_wasm :: builder ()
11
+ . build ()
12
+ . expect (" Failed to build Octocrab client" );
13
+
14
+ // Optionally set a GitHub auth token
15
+ if let Some (token ) = & auth_token {
16
+ client = client
17
+ . user_access_token (token . to_owned ())
18
+ . expect (" Failed to set token" );
19
+ }
20
+
21
+ // Now do some requests!
22
+ ```
You can’t perform that action at this time.
0 commit comments