1
-
2
1
<p align =" center " ><img src =" https://cldup.com/7umchwdUBh.png " /></p >
3
2
4
3
<h3 align =" center " >The official Strapi SDK for JavaScript, available for browsers or Node.js backends.</h3 >
5
4
6
- ***
5
+ ---
7
6
8
7
<p align =" center " >
9
8
<a href="https://travis-ci.org/strapi/strapi-sdk-javascript"><img src="https://img.shields.io/travis/strapi/strapi-sdk-javascript.svg?style=for-the-badge" /></a>
@@ -21,53 +20,52 @@ npm install strapi-sdk-javascript
21
20
22
21
## Start now
23
22
24
- ### Example
25
-
26
23
``` js
27
- import Strapi from ' strapi-sdk-javascript'
24
+ import Strapi from ' strapi-sdk-javascript' ;
25
+
26
+ const strapi = new Strapi (' http://localhost:1337' );
28
27
29
- const strapi = new Strapi (' http://localhost:1337' )
30
28
(async () => {
31
- const posts = await strapi .getEntries (' post' )
32
- console .log (posts .length )
33
- })()
29
+ await strapi .login (' username_or_email' , ' s3cr3t' );
30
+ const posts = await strapi .getEntries (' post' );
31
+ console .log (` Posts count: ${ posts .length } ` );
32
+ })();
34
33
```
35
34
36
- ### API
37
-
38
- - ** Strapi(baseURL, [ requestConfig] ( https://github.com/axios/axios#request-config ) )**
39
- - ** register(username, email, password)**
40
- - ** login(identifier, password)**
41
- - ** forgotPassword(email, url)**
42
- - ** resetPassword(code, password, passwordConfirmation)**
43
- - ** setToken(token)**
44
- - ** request(method, url, requestConfig)**
45
- - ** getEntries(contentType, params)**
46
- - ** getEntry(contentType, id)**
47
- - ** createEntry(contentType, data)**
48
- - ** updateEntry(contentType, id, data)**
49
- - ** deleteEntry(contentType, id)**
50
- - ** searchFiles(query)**
51
- - ** getFiles(params)**
52
- - ** getFile(id)**
53
- - ** upload(data)**
35
+ ## API
36
+
37
+ ### ` Strapi(baseURL, [requestConfig](https://github.com/axios/axios#request-config)) `
38
+ ### ` register(username, email, password) `
39
+ ### ` login(identifier, password) `
40
+ ### ` forgotPassword(email, url) `
41
+ ### ` resetPassword(code, password, passwordConfirmation) `
42
+ ### ` setToken(token) `
43
+ ### ` request(method, url, requestConfig) `
44
+ ### ` getEntries(contentType, params) `
45
+ ### ` getEntry(contentType, id) `
46
+ ### ` createEntry(contentType, data) `
47
+ ### ` updateEntry(contentType, id, data) `
48
+ ### ` deleteEntry(contentType, id) `
49
+ ### ` searchFiles(query) `
50
+ ### ` getFiles(params) `
51
+ ### ` getFile(id) `
52
+ ### ` upload(data) `
54
53
55
54
## Resources
56
55
57
- - [ Documentation] ( https://strapi.github.io/strapi-sdk-javascript )
58
- - [ Changelog] ( https://github.com/strapi/strapi-sdk-javascript/blob/master/CHANGELOG.md )
56
+ * [ Documentation] ( https://strapi.github.io/strapi-sdk-javascript )
57
+ * [ Changelog] ( https://github.com/strapi/strapi-sdk-javascript/blob/master/CHANGELOG.md )
59
58
60
59
## Roadmap
61
60
62
- - GraphQL
63
- - Unit tests
64
- - Providers authentication helpers
65
- - Attach/Detach entry relationship
61
+ * GraphQL
62
+ * Providers authentication helpers
63
+ * Attach/Detach entry relationship
66
64
67
65
## Credits
68
66
69
- - [ axios] ( https://github.com/axios/axios )
70
- - [ typescript-starter] ( https://github.com/bitjson/typescript-starter )
67
+ * [ axios] ( https://github.com/axios/axios )
68
+ * [ typescript-starter] ( https://github.com/bitjson/typescript-starter )
71
69
72
70
## License
73
71
0 commit comments