- Notifications
You must be signed in to change notification settings - Fork45
🔌 Official JavaScript SDK for APIs built with Strapi.
License
strapi/strapi-sdk-javascript
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
We recommend you not to use this package. We stopped to maintained it by lack of time and also because the features provided by this SDK are the same as a good HTTP client well configured.So I suggest you use the best HTTP client for the technology you use. To configure it to target your Strapi API.Here so usefull ressources to help you:
npm install strapi-sdk-javascript
importStrapifrom'strapi-sdk-javascript';conststrapi=newStrapi('http://localhost:1337');
awaitstrapi.login('username_or_email','s3cr3t');
// Redirect your user to the provider's authentication page.window.location=strapi.getProviderAuthenticationUrl('facebook');
Once authorized, the provider will redirects the user to your app with an access token in the URL.
// Complete the authentication: (The SDK will store the access token for you)awaitstrapi.authenticateProvider('facebook');
You can now fetch private APIs
constposts=awaitstrapi.getEntries('posts');
constform=newFormData();form.append('files',fileInputElement.files[0],'file-name.ext');form.append('files',fileInputElement.files[1],'file-2-name.ext');constfiles=awaitstrapi.upload(form);
constFormData=require('form-data');constfs=require('fs');constform=newFormData();form.append('files',fs.createReadStream('./file-name.ext'),'file-name.ext');constfiles=awaitstrapi.upload(form,{headers:form.getHeaders()});
Custom axios request configuration.See documentation
- GraphQL
- Attach/Detach entry relationship
- Real time with Socket.io
MIT
About
🔌 Official JavaScript SDK for APIs built with Strapi.
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors9
Uh oh!
There was an error while loading.Please reload this page.