3.6.6 • Published 9 months ago
@qelos/sdk v3.6.6
@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.6.6
9 months ago
3.6.5
11 months ago
3.5.5
12 months ago
3.5.4
12 months ago
3.6.2
11 months ago
3.6.1
11 months ago
3.5.2
1 year ago
3.6.0
11 months ago
3.5.1
1 year ago
3.5.0
1 year ago
3.4.1
1 year ago
3.4.0
1 year ago
3.3.9
2 years ago
3.3.8
2 years ago
3.3.6
2 years ago
3.2.2
2 years ago
3.2.0
2 years ago
3.2.3
2 years ago
3.2.7
2 years ago
3.1.31
2 years ago
3.1.23
2 years ago
3.1.12
3 years ago
3.1.3
3 years ago
3.1.11
3 years ago
3.1.2
3 years ago
3.1.1
3 years ago
3.1.24
2 years ago
3.1.0
3 years ago
3.1.16
2 years ago
3.1.7
3 years ago
3.1.15
2 years ago
3.1.20
2 years ago
3.1.9
3 years ago
3.1.8
3 years ago
3.0.1
3 years ago
2.0.22
3 years ago