3.4.1 • Published 15 days ago
@qelos/sdk v3.4.1
@qelos/sdk
SDK to use Qelos common API endpoints.
Can be used for both backend and frontend applications.
Installation
npm install @qelos/sdk
Usage
// my-sdk.ts
import QelosSDK from '@qelos/sdk';
const sdk = new QelosSDK({appUrl: 'https://yourdomain.com', fetch: window.fetch});
export default sdk;
Note: You can inject a fetch-like function, such as node-fetch
or any fetch equivalent.
Basic usage of SDK instance:
// MyPostsList.tsx
import sdk from './my-sdk';
function MyPostsList() {
const [posts, setPosts] = useState([]);
const [querySearch, setQuery] = useState([]);
useEffect(() => {
sdk.posts.getList({q: querySearch, limit: 50});
}, [querySearch]);
return (
<div>
<input type="text" placeholder="Search posts" onChange={e => setQuery(e.target.value)}/>
{
posts.map(post => <PostItem post={post} key={post._id}/>)
}
</div>
)
}
Enjoy!
3.4.1
15 days ago
3.4.0
26 days ago
3.3.9
10 months ago
3.3.8
11 months ago
3.3.6
12 months ago
3.2.2
1 year ago
3.2.0
1 year ago
3.2.3
1 year ago
3.2.7
1 year ago
3.1.31
1 year ago
3.1.23
1 year ago
3.1.12
1 year ago
3.1.3
1 year ago
3.1.11
1 year ago
3.1.2
1 year ago
3.1.1
1 year ago
3.1.24
1 year ago
3.1.0
1 year ago
3.1.16
1 year ago
3.1.7
1 year ago
3.1.15
1 year ago
3.1.20
1 year ago
3.1.9
1 year ago
3.1.8
1 year ago
3.0.1
1 year ago
2.0.22
2 years ago