+
+
+
+
+
diff --git a/docs/components/Logo.vue b/docs/components/Logo.vue
new file mode 100644
index 00000000..16b11441
--- /dev/null
+++ b/docs/components/Logo.vue
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/docs/content/0.index.md b/docs/content/0.index.md
new file mode 100644
index 00000000..a60f0228
--- /dev/null
+++ b/docs/content/0.index.md
@@ -0,0 +1,43 @@
+---
+title: Home
+navigation: false
+layout: page
+main:
+ fluid: false
+---
+
+:ellipsis{right=0px width=75% blur=150px}
+
+::block-hero
+---
+cta:
+ - Get started
+ - /getting-started/setup
+secondary:
+ - Open on GitHub โ
+ - https://github.com/stun3r/strapi-sdk-js
+---
+
+#title
+Strapi SDK
+
+#description
+The SDK for seamless integration with your [Strapi](https://strapi.io) API.
+
+#extra
+ ::list
+ - Support Strapi v4
+ - RESTful methods
+ - Typescript support
+ - Simplified request responses
+ - Formatted error handling
+ ::
+
+#support
+ ::terminal
+ ---
+ content:
+ - npm i --save strapi-sdk-js
+ ---
+ ::
+::
\ No newline at end of file
diff --git a/docs/content/1.getting-started/1.setup.md b/docs/content/1.getting-started/1.setup.md
new file mode 100644
index 00000000..7eabcdd4
--- /dev/null
+++ b/docs/content/1.getting-started/1.setup.md
@@ -0,0 +1,47 @@
+---
+title: Setup
+description: "Discover how to setup this beautiful SDK."
+---
+
+# Setup
+
+Discover how to setup this beautiful SDK. โจ
+
+::alert
+If you are using Strapi **v3**, check out [here](https://v1-strapi-sdk-js.netlify.app) the documentation of the SDK `v1`
+::
+
+## Installation
+
+Add `strapi-sdk-js` dependency to your project:
+
+::code-group
+ ```bash [Yarn]
+ yarn add strapi-sdk-js
+ ```
+ ```bash [NPM]
+ npm install --save strapi-sdk-js
+ ```
+::
+
+Then you can create a new instance by importing `strapi-sdk-js` in your project:
+
+```ts
+import Strapi from "strapi-sdk-js"
+
+const strapi = new Strapi()
+```
+
+## Configuration
+
+You can pass multiple options to the `constructor`:
+
+```js
+import Strapi from "strapi-sdk-js"
+
+const strapi = new Strapi({
+ // Options
+})
+```
+
+> Check out the [Options](/api/options) page for available options.
diff --git a/docs/content/1.getting-started/2.usage.md b/docs/content/1.getting-started/2.usage.md
new file mode 100644
index 00000000..cd651635
--- /dev/null
+++ b/docs/content/1.getting-started/2.usage.md
@@ -0,0 +1,102 @@
+---
+title: Usage
+description: "Learn how to use this SDK."
+---
+
+# Usage
+
+Learn how to use this SDK. ๐
+
+## New instance
+
+Here is how you can instantiate the Strapi SDK.
+
+::code-group
+
+```ts [Minimal]
+import Strapi from "strapi-sdk-js"
+
+const strapi = new Strapi()
+```
+
+```ts [Custom]
+import Strapi from "strapi-sdk-js"
+
+const strapi = new Strapi({
+ url: "http://localhost:1337",
+ prefix: "/api",
+ store: {
+ key: "strapi_jwt",
+ useLocalStorage: false,
+ cookieOptions: { path: "/" },
+ },
+ axiosOptions: {},
+})
+```
+
+::
+
+> Check out the [Options](/api/options) page for available options.
+
+## Content Types
+
+All **contentTypes** methods are built based on the default Strapi CRUD operations.
+
+- [`find`](/api/methods#find)
+- [`findOne`](/api/methods#findOne)
+- [`count`](/api/methods#count)
+- [`create`](/api/methods#create)
+- [`update`](/api/methods#update)
+- [`delete`](/api/methods#delete)
+
+```ts
+await strapi.find("restaurants", { ...params })
+```
+
+> Check out the [CRUD Methods](/api/methods#crud) section for more information.
+
+## Authentication
+
+The SDK comes with all the methods needed to handle authentication. You can find below the list of all the methods available:
+
+- [`register`](/api/methods#register)
+- [`login`](/api/methods#login)
+- [`changePassword`](/api/methods#changepassword)
+- [`forgotPassword`](/api/methods#forgotpassword)
+- [`resetPassword`](/api/methods#resetpassword)
+- [`sendEmailConfirmation`](/api/methods#sendemailconfirmation)
+- [`getProviderAuthenticationUrl`](/api/methods#getproviderauthenticationurl)
+- [`authenticateProvider`](/api/methods#authenticateprovider)
+- [`logout`](/api/methods#logout)
+- [`setUser`](/api/methods#setuser)
+- [`fetchUser`](/api/methods#fetchuser)
+- [`getToken`](/api/methods#gettoken)
+- [`setToken`](/api/methods#settoken)
+- [`removeToken`](/api/methods#removetoken)
+
+> Check out the [Authentication Methods](/api/methods#authentication) section for more information.
+
+## Advanced
+
+### Accessing user
+
+Once you're logged in, you can access the `user` object which contains details about authenticated user through the `strapi.user` property.
+
+### Accessing axios
+
+This SDK uses `axios` under the hood, you can directly access the `axios` instance through the `strapi.axios` property.
+
+### Custom request
+
+If you've defined custom routes in your Strapi API that go beyond the REST scope, or if you want to extend the `axios` request configuration, you can do as below:
+
+```ts
+const response = await strapi.request("get", "/restaurants", {
+ headers: {
+ foo: "bar",
+ },
+})
+```
+
+> See the [axios config](https://github.com/axios/axios#request-config)
+
diff --git a/docs/content/1.getting-started/_dir.yml b/docs/content/1.getting-started/_dir.yml
new file mode 100644
index 00000000..d794cef2
--- /dev/null
+++ b/docs/content/1.getting-started/_dir.yml
@@ -0,0 +1,2 @@
+icon: fxemoji:rocket
+navigation.redirect: /getting-started/setup
diff --git a/docs/content/2.api/1.methods.md b/docs/content/2.api/1.methods.md
new file mode 100644
index 00000000..b77d2d6a
--- /dev/null
+++ b/docs/content/2.api/1.methods.md
@@ -0,0 +1,330 @@
+---
+title: Methods
+description: "Discover how to use this beautiful SDK."
+---
+
+# Methods
+
+Discover how to use this beautiful SDK. ๐ฅ
+
+## CRUD
+
+### `find`
+
+- **Parameters**
+ - contentType: `string`
+ - params?: [`StrapiRequestParams`](types#strapirequestparams)
+- **Returns:** [`Promise>`](types#strapiresponset)
+
+Retrieve a list of content type entries that match the query filters. **Strapi v4** introduces new query filters.
+
+::code-group
+ ```ts [Minimal]
+ await strapi.find('restaurants')
+ ```
+ ```ts [With parameters]
+ await strapi.find('restaurants', {
+ filters: {
+ name: {
+ $eq: 'La Fourchette'
+ }
+ },
+ sort: 'name:asc',
+ pagination: {
+ start: 0,
+ limit: 0
+ },
+ fields: [...],
+ populate: [...] || '' || {},
+ publicationState: 'live',
+ locale: 'all'
+ })
+ ```
+::
+
+> Check out the [Strapi documentation](https://docs.strapi.io/dev-docs/api/rest#api-parameters) for more information.
+
+
+### `findOne`
+
+- **Parameters**
+ - contentType: `string`
+ - id: `string|number`
+ - params?: [`StrapiBaseRequestParams`](types#strapibaserequestparams)
+- **Returns:** [`Promise>`](types#strapiresponset)
+
+Retrieve a specific content type entry by its ID. You can enhance your query by adding filters to select the returning `fields` and `populate` relations.
+
+::code-group
+ ```ts [Minimal]
+ await strapi.findOne('restaurants', 1)
+ ```
+ ```ts [With parameters]
+ await strapi.findOne('restaurants', 1, {
+ fields: ['id', 'name']
+ populate: ['menu'],
+ })
+ ```
+::
+
+### `create`
+
+- **Parameters**
+ - contentType: `string`
+ - data: `AxiosRequestConfig["data"]`
+ - params?: [`StrapiBaseRequestParams`](types#strapibaserequestparams)
+- **Returns:** [`Promise>`](types#strapiresponset)
+
+Create a content type entry and returns its value. You can apply query filters to choose the returning `fields` and `populate` relations.
+
+::code-group
+ ```ts [Minimal]
+ await strapi.create('restaurants', { name: 'The Fork' })
+ ```
+ ```ts [With parameters]
+ await strapi.create('restaurants', { name: 'The Fork' }, {
+ fields: ['id', 'name']
+ populate: ['menu'],
+ })
+ ```
+::
+
+### `update`
+
+- **Parameters**
+ - contentType: `string`
+ - id: `string|number`
+ - data: `AxiosRequestConfig["data"]`
+ - params?: [`StrapiBaseRequestParams`](types#strapibaserequestparams)
+- **Returns:** [`Promise>`](types#strapiresponset)
+
+Update a content type entry by its ID, and receive the updated entry in return. You can apply query filters to specify the returning fields and populate relations.
+
+::code-group
+ ```ts [Minimal]
+ await strapi.update('restaurants', 1, { name: 'The Fork' })
+ ```
+ ```ts [With parameters]
+ await strapi.update('restaurants', 1, { name: 'The Fork' }, {
+ fields: ['id', 'name']
+ populate: ['menu'],
+ })
+ ```
+::
+
+### `delete`
+
+- **Parameters**
+ - contentType: `string`
+ - id: `string|number`
+ - params?: [`StrapiBaseRequestParams`](types#strapibaserequestparams)
+- **Returns:** [`Promise>`](types#strapiresponset)
+
+Delete a content type entry by its ID, and receive the deleted entry in return. You can apply query filters to define the returning `fields` and `populate` relations.
+
+::code-group
+ ```ts [Minimal]
+ await strapi.delete('restaurants', 1)
+ ```
+ ```ts [With parameters]
+ await strapi.delete('restaurants', 1, {
+ fields: ['id', 'name']
+ populate: ['menu'],
+ })
+ ```
+::
+
+## Authentication
+
+### `register`
+
+- **Parameters**
+ - data: [`StrapiRegistrationData`](types#strapiregistrationdata)
+- **Returns:** [`Promise`](types#strapiauthenticationresponse)
+
+Register a new [User](properties#user) and set the associated [Token](methods#settoken).
+
+```ts
+const { user, jwt } = await strapi.register({ username: '', email: '', password: '' })
+```
+
+> Check out the [Strapi documentation](https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#registration) for more information.
+
+### `login`
+
+- **Parameters**
+ - data: [`StrapiAuthenticationData`](types#strapiauthenticationdata)
+- **Returns:** [`Promise`](types#strapiauthenticationresponse)
+
+Authenticate a [User](properties#user) and set the associated [Token](methods#settoken).
+
+```ts
+const { user, jwt } = await strapi.login({ identifier: '', password: '' })
+```
+
+> Check out the [Strapi documentation](https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#login) for more information.
+
+### `logout`
+
+It logs out the user by removing the authentication token from the [chosen storage](options#store) & `axios` header.
+
+```ts
+strapi.logout()
+```
+
+### `changePassword`
+
+:badge[v2.3.0+]
+:badge[Strapi v4.3.3+]
+
+- **Parameters**
+ - data: [`StrapiChangePasswordData`](types#strapichangepassworddata)
+- **Returns:** [`Promise`](types#strapiauthenticationresponse)
+
+Change the password for the currently logged-in user.
+
+```ts
+const { user, jwt } = await strapi.changePassword({ currentPassword: '', password: '', passwordConfirmation: '' })
+```
+
+> Check out the [Strapi documentation](https://docs.strapi.io/dev-docs/plugins/users-permissions#reset-password) for more information.
+
+### `forgotPassword`
+
+- **Parameters**
+ - data: [`StrapiForgotPasswordData`](types#strapiforgotpassworddata)
+- **Returns:** `Promise`
+
+Change the password for the currently logged-in user.
+
+```ts
+await strapi.forgotPassword({ email: '' })
+```
+
+> Check out the [Strapi documentation](https://docs.strapi.io/dev-docs/plugins/users-permissions#reset-password) for more information.
+
+### `resetPassword`
+
+- **Parameters**
+ - data: [`StrapiResetPasswordData`](types#strapiresetpassworddata)
+- **Returns:** [`Promise`](types#strapiauthenticationresponse)
+
+Reset the user password and set the associated [Token](methods#settokentoken).
+
+```ts
+const { user, jwt } = await strapi.resetPassword({ code: '', password: '', passwordConfirmation: '' })
+```
+
+> Check out the [Strapi documentation](https://docs.strapi.io/dev-docs/plugins/users-permissions#reset-password) for more information.
+
+### `sendEmailConfirmation`
+
+- **Parameters**
+ - data: [`StrapiEmailConfirmationData`](types#strapiemailconfirmationdata)
+- **Returns:** `Promise`
+
+Send an email to a user programmatically to confirm their account.
+
+```ts
+await strapi.sendEmailConfirmation({ email: '' })
+```
+
+> Check out the [Strapi documentation](https://docs.strapi.io/dev-docs/plugins/users-permissions#email-validation) for more information.
+
+### `getProviderAuthenticationUrl`
+
+- **Parameters**
+ - provider: [`StrapiAuthProvider`](types#strapiauthprovider)
+- **Returns:** `string`
+
+Retrieve the correct authentication page URL for a given provider.
+
+```ts
+window.location = strapi.getAuthenticationProvider('provider')
+```
+
+> Check out the [Strapi Provider list](https://docs.strapi.io/dev-docs/plugins/users-permissions#setting-up-the-provider---examples) for more information.
+
+### `authenticateProvider`
+
+- **Parameters**
+ - provider: [`StrapiAuthProvider`](types#strapiauthprovider)
+ - access_token: `string`
+- **Returns:** [`Promise`](types#strapiauthenticationresponse)
+
+After authorization, the provider will **redirect the user to your frontend with an access token in the URL**. The `access_token` parameter is not necessary if it's already included in your URL redirection, but you can provide one if needed.
+
+::code-group
+ ```ts [Token in URL]
+ const { user, jwt } = await strapi.authenticateProvider('provider')
+ ```
+ ```ts [Provide a token]
+ const { user, jwt } = await strapi.authenticateProvider('provider', 'my_access_token')
+ ```
+::
+
+> Check out the [Strapi documentation](https://docs.strapi.io/dev-docs/plugins/users-permissions#setup-the-frontend) for more information.
+
+### `setUser`
+
+- **Parameters**
+ - user: [`StrapiUser`](types#strapiuser)
+- **Returns:** `void`
+
+Set local data for the logged-in user.
+
+```ts
+strapi.setUser(user)
+```
+
+::alert{type=warning}
+This method is no longer supported in :badge[v2.2.0+] since the `getter` and `setter` for `user` properties have been removed. Now, you can use `strapi.user` to both set and get user data.
+::
+
+### `fetchUser`
+
+- **Returns:** [`Promise`](types#strapiuser)
+
+Fetching user data is a common requirement. You can use this method to retrieve the current user from `/users/me` when a `JWT` is stored in your [storage](options#store). It then sets the [User](properties#user).
+
+```ts
+const user = await strapi.fetchUser()
+```
+
+### `getToken`
+
+:badge[v2.2.0+]
+
+- **Returns:** `string | null`
+
+Retrieve your JWT token from selected [storage](options#store).
+
+```ts
+const token = strapi.getToken()
+```
+
+### `setToken`
+
+:badge[v2.2.0+]
+
+- **Parameters**
+ - token: `string`
+- **Returns:** `void`
+
+Set your JWT token in `axios` headers as a `Bearer` token and store it in the selected [storage](options#store).
+
+```ts
+const token = strapi.setToken('my_jwt_token')
+```
+
+### `removeToken`
+
+:badge[v2.2.0+]
+
+- **Returns:** `void`
+
+Remove your JWT token from `axios` headers and the selected [storage](options#store).
+
+```ts
+strapi.removeToken()
+```
diff --git a/docs/content/2.api/2.options.md b/docs/content/2.api/2.options.md
new file mode 100644
index 00000000..365d623c
--- /dev/null
+++ b/docs/content/2.api/2.options.md
@@ -0,0 +1,62 @@
+---
+title: Options
+description: "Learn how to configure your Strapi SDK"
+---
+
+# Options
+
+Learn how to configure your Strapi SDK. ๐ฅ
+
+### `url`
+
+- Type: `string`
+- Default: `process.env.STRAPI_URL || http://localhost:1337`
+
+The URL of the Strapi server. You can use the `STRAPI_URL` environment variable to override the `url`.
+
+::alert{type=warning}
+Since :badge[v2.1.4] `process.env.STRAPI_URL` is no longer used by default.
+::
+
+### `prefix`
+
+- Type: `string`
+- Default: `/api`
+
+In **Strapi v4**, you have the capability to modify the API endpoint `prefix`. The default `prefix` is `/api`, allowing you to access your API at `http://localhost:1337/api`.
+
+> Check out the [API configuration](https://docs.strapi.io/dev-docs/configurations/api#api-configuration) to learn how to change the default prefix.
+
+### `store`
+
+- Type: [`StoreConfig`](types#storeconfig)
+ - `key`
+ - Type: `string`
+ - Default: `strapi_jwt`
+ - `useLocalStorage`
+ - Type: `boolean`
+ - Default: `false`
+ - `cookieOptions`
+ - Type: `object`
+ - Default: `{ path: "/" }`
+
+The store's configuration allows you to set the `key` for the cookie name, as well as the localStorage key if you choose to use it thanks the `useLocalStorage` boolean property. Additionally, you can provide `cookieOptions` to be passed to the [js-cookie](https://github.com/jshttp/cookie#options-1) package.
+
+```ts
+import Strapi from "strapi-sdk-js"
+
+const strapi = new Strapi({
+ store: {
+ key: "strapi_jwt",
+ useLocalStorage: false,
+ cookieOptions: { path: "/" },
+ },
+})
+```
+
+### `axiosOptions`
+
+- Type: `AxiosRequestConfig`
+- Default: `{}`
+
+Options to be passed to the [Axios instance](https://github.com/axios/axios#request-config).
diff --git a/docs/content/2.api/3.properties.md b/docs/content/2.api/3.properties.md
new file mode 100644
index 00000000..055ad832
--- /dev/null
+++ b/docs/content/2.api/3.properties.md
@@ -0,0 +1,35 @@
+---
+title: Properties
+description: "Here are the properties you can access."
+---
+
+# Properties
+
+Below are the properties you can access. ๐ฅ
+
+## `user`
+
+- Type: [`StrapiUser`](types#strapiuser)
+
+This object contains details about the authenticated user, which you can access using `strapi.user`.
+
+::code-group
+ ```ts [Getter]
+ strapi.user
+ ```
+ ```ts [Setter]
+ strapi.user.avatar = ""
+ ```
+::
+
+## `axios`
+
+You have access to the axios instance through `strapi.axios`. This allows you to set new headers or extend it:
+
+```ts
+strapi.axios.defaults.headers.common["Authorization"] = `Bearer myToken`
+```
+
+Note that we use [axios interceptors](https://axios-http.com/docs/interceptors) in order to synchronize your JWT token in header.
+
+> Check out the [Axios documentation](https://github.com/axios/axios) for more information.
diff --git a/docs/content/2.api/4.types.md b/docs/content/2.api/4.types.md
new file mode 100644
index 00000000..f0018a21
--- /dev/null
+++ b/docs/content/2.api/4.types.md
@@ -0,0 +1,258 @@
+---
+title: Types
+description: "Since this package has been designed using TypeScript, it inherently provides native support for it."
+---
+
+# Types
+
+Since this package has been designed using TypeScript, it inherently provides native support for it. ๐ฅ
+
+## Axios
+
+Here is the list of all `axios` interfaces and types used in this package:
+
+- `AxiosInstance`: used for the `strapi.axios` property.
+- `AxiosRequestConfig`: used for the [axiosOptions](options#axiosoptions) in the `Strapi Constructor` and the custom [`request`](/getting-started/usage#custom-request) method.
+- `Method`: (which is a `type`) used for the parameter `method` in the custom [`request`](/getting-started/usage#custom-request) method.
+
+## Internal
+
+Below is a list of all the custom types and interfaces used in this package.
+
+You can easily use them by importing them.
+
+```ts
+import Strapi, { StrapiOptions } from "strapi-sdk-js"
+
+const options: StrapiOptions = {
+ url: "http://strapi-host/",
+}
+
+const strapi = new Strapi(options)
+```
+
+### `StrapiOptions`
+
+Options to configure a [new Strapi SDK instance](/getting-started/usage#new-instance).
+
+```ts
+interface StrapiConfig {
+ url?: string
+ store?: StoreConfig
+ axiosOptions?: AxiosRequestConfig
+}
+```
+
+### `StoreConfig`
+
+Used for [store](options#store) configuration in [Strapi SDK instanciation](/getting-started/usage#new-instance).
+
+```ts
+interface StoreConfig {
+ key: string
+ useLocalStorage?: boolean
+ cookieOptions?: CookieAttributes
+}
+```
+
+### `StrapiBaseRequestParams`
+
+Strapi query filters used in [findOne](methods#findOne), [create](methods#create), [update](methods#update), [delete](methods#delete) methods.
+
+```ts
+interface StrapiBaseRequestParams {
+ fields?: Array
+ populate?: string | Array | Record
+}
+```
+
+> Check out the [Strapi REST API documentation](https://docs.strapi.io/dev-docs/api/rest/parameters) for more information.
+
+### `StrapiRequestParams`
+
+Strapi query filters used in [find](methods#find) methods.
+
+```ts
+interface StrapiRequestParams extends StrapiBaseRequestParams {
+ sort?: string | Array
+ pagination?: PaginationByOffset | PaginationByPage
+ filters?: Record
+ publicationState?: "live" | "preview"
+ locale?: StrapiLocale
+}
+```
+
+> Check out the [Strapi REST API documentation](https://docs.strapi.io/dev-docs/api/rest/parameters) for more information.
+
+### `PaginationByPage`
+
+With **Strapi v4**, results can be paginated. This type is used in [StrapiRequestParams](#StrapiRequestParams) to paginate the results by page.
+
+```ts
+interface PaginationByPage {
+ page: number
+ pageSize: number
+ withCount?: boolean
+}
+```
+
+> Check out the [Strapi Pagination documentation](https://docs.strapi.io/dev-docs/api/rest/sort-pagination#pagination-by-page) for more information.
+
+### `PaginationByOffset`
+
+With **Strapi v4**, results can be paginated. This type is used in [StrapiRequestParams](#StrapiRequestParams) to paginate the results by offset.
+
+```ts
+interface PaginationByOffset {
+ start: number
+ limit: number
+ withCount?: boolean
+}
+```
+
+> Check out the [Strapi Pagination documentation](https://docs.strapi.io/dev-docs/api/rest/sort-pagination#pagination-by-offset) for more information.
+
+### `StrapiLocale`
+
+This type is used in [StrapiRequestParams](#StrapiRequestParams) to retrieve content by locale.
+
+```ts
+type StrapiLocale = | "af" | "af-NA" | "af-ZA" | "agq" ...
+```
+
+> Check out the [Strapi i18n documentation](https://docs.strapi.io/dev-docs/plugins/i18n#getting-localized-entries-with-the-locale-parameter) for more information.
+
+### `StrapiResponse`
+
+**Strapi v4** introduces a new response object. With this update, you have access to a `data` object (containing the response data itself) and a `meta` object (providing information about pagination, publication state, available locales, and more).
+
+```ts
+interface StrapiResponse {
+ data: T
+ meta: Record
+}
+```
+
+> Check out the [Strapi Requests documentation](https://docs.strapi.io/dev-docs/api/rest#requests) for more information.
+
+### `StrapiError`
+
+Errors are included in the response object with the `error` key and include information such as the HTTP `status` code, the `name` of the error, and additional information.
+
+```ts
+interface StrapiError {
+ data: null
+ error: {
+ status: number
+ name: string
+ message: string
+ details: Record
+ }
+}
+```
+
+> Check out the [Strapi Error handling documentation](https://docs.strapi.io/dev-docs/error-handling) for more information.
+
+### `StrapiUser`
+
+Types of the user returned by Strapi. Returned by [`fetchUser`](methods#fetchuser) method.
+
+### `StrapiAuthProvider`
+
+Used for the `provider` parameter in the [getProviderAuthenticationUrl](methods#getproviderauthenticationurl) and [authenticateProvider](methods#authenticateprovider) methods.
+
+```ts
+type StrapiAuthProvider =
+ | "github"
+ | "facebook"
+ | "google"
+ | "cognito"
+ | "twitter"
+ | "discord"
+ | "twitch"
+ | "instagram"
+ | "vk"
+ | "linkedin"
+ | "reddit"
+ | "auth0"
+```
+
+> Check out the [Strapi Authentication Provider documentation](https://docs.strapi.io/dev-docs/plugins/users-permissions#providers) for more information.
+
+### `StrapiAuthenticationResponse`
+
+The return object type in the [register](methods#register), [login](methods#login), [changePassword](methods#changepassword), [resetPassword](methods#resetpassword), [forgotPassword](methods#forgotpassword), [resetPassword](methods#resetpassword) and [authenticateProvider](methods#authenticateprovider) methods.
+
+```ts
+interface StrapiAuthenticationResponse {
+ user: Record
+ jwt: string
+}
+```
+
+### `StrapiAuthenticationData`
+
+Used for the `data` parameter in the [login](methods#login) method.
+
+```ts
+interface StrapiAuthenticationData {
+ identifier: string
+ password: string
+}
+```
+
+### `StrapiRegistrationData`
+
+Used for the `data` parameter in the [register](methods#register) method.
+
+```ts
+interface StrapiRegistrationData {
+ username: string
+ email: string
+ password: string
+}
+```
+
+### `StrapiChangePasswordData`
+
+Used for the `data` parameter in the [changePassword](methods#changepassword) method.
+
+```ts
+interface StrapiChangePasswordData {
+ currentPassword: string
+ password: string
+ passwordConfirmation: string
+}
+```
+
+### `StrapiForgotPasswordData`
+
+Used for the `data` parameter in the [forgotPassword](methods#forgotpassword) method.
+
+```ts
+interface StrapiForgotPasswordData {
+ email: string
+}
+```
+
+### `StrapiResetPasswordData`
+
+Used for the `data` parameter in the [resetPassword](methods#resetpassword) method.
+
+```ts
+interface StrapiResetPasswordData {
+ code: string
+ password: string
+ passwordConfirmation: string
+}
+```
+
+### `StrapiEmailConfirmationData`
+
+Used for the `data` parameter in the [sendEmailConfirmation](methods#sendemailconfirmation) method.
+
+```ts
+interface StrapiEmailConfirmationData {
+ email: string
+}
+```
diff --git a/docs/content/2.api/_dir.yml b/docs/content/2.api/_dir.yml
new file mode 100644
index 00000000..7123a7dd
--- /dev/null
+++ b/docs/content/2.api/_dir.yml
@@ -0,0 +1,3 @@
+title: "API"
+navigation.redirect: /api/methods
+icon: emojione:desktop-computer
diff --git a/docs/content/3.going-further/1.handling-errors.md b/docs/content/3.going-further/1.handling-errors.md
new file mode 100644
index 00000000..dd8f7db3
--- /dev/null
+++ b/docs/content/3.going-further/1.handling-errors.md
@@ -0,0 +1,27 @@
+---
+title: Handling Errors
+description: "Discover how to handle errors from Strapi."
+---
+
+# Handling Errors
+
+Discover how to handle errors from Strapi. ๐ก
+
+Thanks to **Strapi v4**, handling errors is no longer a time-consuming task.
+You now have a well-formatted error object following this structure:
+
+```ts
+{
+ data: null,
+ error: {
+ status: "", // HTTP status
+ name: "", // Strapi error name ('ApplicationError' or 'ValidationError')
+ message: "", // A human readable error message
+ details: {
+ // error info specific to the error type
+ }
+ }
+}
+```
+
+> Checkout the [Strapi Error handling documentation](https://docs.strapi.io/dev-docs/error-handling#rest-errors) for more information.
\ No newline at end of file
diff --git a/docs/content/3.going-further/2.integrations.md b/docs/content/3.going-further/2.integrations.md
new file mode 100644
index 00000000..aaec4c1b
--- /dev/null
+++ b/docs/content/3.going-further/2.integrations.md
@@ -0,0 +1,131 @@
+---
+title: Integrations
+description: 'How to use this SDK within your favorite Framework.'
+---
+
+# Integrations
+
+How to use this SDK within your favorite Framework. ๐
+
+## React
+
+Create a `strapi.js` file to set up your Strapi SDK instance. Then, import this file wherever you need to use it.
+
+::code-group
+ ```ts [strapi.js]
+ import Strapi from 'strapi-sdk-js'
+
+ export const strapi = new Strapi({
+ // ...options
+ })
+ ```
+ ```tsx [Usage]
+ import { strapi } from '~/strapi'
+
+ const MyComponent = () => {
+
+ const handleFetch = async () => {
+ try {
+ const response = await strapi.find('restraurants')
+ } catch (error) {
+ console.error(error)
+ }
+ }
+
+ return
+ }
+ ```
+::
+
+## Nuxt 3
+
+::alert
+If you want to easily fetch your Strapi content from a Nuxt 3 application, you can check the [Strapi module](https://strapi.nuxtjs.org/) developed by the Nuxt team.
+::
+
+Unlike **Nuxt 2**, you only need to set up a `plugin`, and then you can simply access `$strapi` using `useNuxtApp` wherever you need to use it.
+
+::code-group
+ ```ts [~/plugins/strapi.js]
+ import { defineNuxtPlugin } from '#app'
+ import Strapi from 'strapi-sdk-js'
+
+ export default defineNuxtPlugin(() => {
+ const strapi = new Strapi({
+ // options
+ })
+ return {
+ provide: {
+ strapi,
+ },
+ }
+ })
+ ```
+ ```ts [Usage]
+
+ ```
+::
+
+## Nuxt 2
+
+To use the `Strapi SDK` globally, set up a `plugin` and include it in the `nuxt.config.js` file:
+
+::code-group
+ ```ts [~/plugins/strapi.js]
+ import Strapi from 'strapi-sdk-js'
+
+ export default (_, inject) => {
+ const strapi = new Strapi({
+ // options
+ })
+
+ inject('strapi', strapi)
+ }
+ ```
+ ```ts [nuxt.config.js]
+ export default {
+ // ...
+ plugins: ['~/plugins/strapi'],
+ // ...
+ build: {
+ extend(config) {
+ config.module.rules.push({
+ test: /\.mjs$/,
+ include: /node_modules/,
+ type: 'javascript/auto',
+ })
+ },
+ },
+ }
+ ```
+::
+
+Now, you can use it globally with `this.$strapi` in components and `app.$strapi` in the `asyncData` function.
+
+## Webpack
+
+In some case, your webpack based application will not support by default `.mjs` files. In order to fix this you can update your webpack config with the following configuration:
+
+```js [webpack.config.js]
+module.exports = {
+ // ...other configuration options
+
+ resolve: {
+ extensions: [..., '.mjs'], // Add '.mjs' to the list of extensions
+ },
+
+ module: {
+ rules: [
+ {
+ test: /\.mjs$/,
+ include: /node_modules/,
+ type: 'javascript/auto', // Use the 'javascript/auto' type for .mjs files
+ },
+ ],
+ },
+}
+```
\ No newline at end of file
diff --git a/docs/content/3.going-further/_dir.yml b/docs/content/3.going-further/_dir.yml
new file mode 100644
index 00000000..0ff6b5fa
--- /dev/null
+++ b/docs/content/3.going-further/_dir.yml
@@ -0,0 +1,2 @@
+navigation.redirect: /going-further/handling-errors
+icon: fxemoji:lightbulb
diff --git a/docs/content/4.releases.md b/docs/content/4.releases.md
new file mode 100644
index 00000000..35bbc769
--- /dev/null
+++ b/docs/content/4.releases.md
@@ -0,0 +1,145 @@
+# Releases
+
+## v2.3.2
+
+#### ๐ทโโ๏ธ Build
+
+- **deps**: fix ufo import ([03f3a5d](https://github.com/Stun3R/strapi-sdk-js/commit/03f3a5d0fd674e12cc015cc16aad1b093e697950)), closes [#181](https://github.com/Stun3R/strapi-sdk-js/issues/181) thanks **@flavienrako**
+
+#### Full Changelog
+https://github.com/Stun3R/strapi-sdk-js/compare/v2.3.1...v2.3.2
+
+## v2.3.1
+
+#### ๐ทโโ๏ธ Build
+
+- update the build target to support webpack based frameworks ([e8c10ef](https://github.com/Stun3R/strapi-sdk-js/commit/e8c10ef74f757cb36d622b785c2d3ef4637fee54)), closes [#179](https://github.com/Stun3R/strapi-sdk-js/issues/179)
+
+#### Full Changelog
+https://github.com/Stun3R/strapi-sdk-js/compare/v2.3.0...v2.3.1
+
+## v2.3.0
+
+#### ๐ Bug Fixes
+
+- add options `prefix` to `getProviderAuthenticationUrl` method ([3b90446](https://github.com/Stun3R/strapi-sdk-js/commit/3b904463da52741cc88d9e7dbd09c20235f63e93)), closes [#140](https://github.com/Stun3R/strapi-sdk-js/issues/140)
+- remove URL constructor to allow relative URL ([e6b9022](https://github.com/Stun3R/strapi-sdk-js/commit/e6b9022585fbf7dd8a01ffa219138f8e4bf5b533)), closes [#145](https://github.com/Stun3R/strapi-sdk-js/issues/145)
+
+#### ๐ Features
+
+- add `change-password` request added in strapi v.4.3.3 ([7c2242a](https://github.com/Stun3R/strapi-sdk-js/commit/7c2242abfffd4237b1fe8c604fdf71c6adeb1baf)) **@AnnikenYT**
+
+#### ๐ทโโ๏ธ Build
+
+- switch from `siroc` to `rollup` since siroc is no longer maintained ([76d798c](https://github.com/Stun3R/strapi-sdk-js/commit/76d798c5937511e431ab886d23454e730ad1b0d5))
+
+#### ๐ก Chore
+
+- **deps:** update dependency `axios` to ^0.27.0 ([4dcbe9b](https://github.com/Stun3R/strapi-sdk-js/commit/4dcbe9b7c689d16fdded207f5bd8ad78ece8ac24))
+- **deps:** update dependency `defu` to v5.0.1 ([f3c86e2](https://github.com/Stun3R/strapi-sdk-js/commit/f3c86e27ab50e08c3d7d399a4dcd395e369699ab))
+- **deps:** update dependency `js-cookie` to v3.0.5 ([844af89](https://github.com/Stun3R/strapi-sdk-js/commit/844af89186d9c86ee8103fd40a8aa078f6be11ca))
+- **deps:** update dependency `qs` to v6.11.2 ([080f39c](https://github.com/Stun3R/strapi-sdk-js/commit/080f39c4de6c37e8b76919bd9f98b459690dd871))
+
+#### Full Changelog
+https://github.com/Stun3R/strapi-sdk-js/compare/v2.2.0...v2.3.0
+
+## v2.2.0
+
+#### โป๏ธ Refactor
+
+* **user:** remove user's property `setter` & `getter` for better readability & `setUser` method. #130
+* **token:** remove `syncToken` and replace it via [axios interceptors](https://axios-http.com/docs/interceptors). **JWT Token** should be added into into `axios` headers at every request now. #131
+
+## v2.1.5
+
+#### ๐ทโโ๏ธ Build
+
+- Seems to have some issue as some project doesn't recognise ES module so I removed es.js & replace it by .mjs ([16106d8](https://github.com/Stun3R/strapi-sdk-js/commit/16106d8f00a2a814eaf4f1d7710a0cec67132ddd))
+
+## v2.1.4
+
+#### ๐ฅ**BREAKING CHANGES**
+
+* Since `process` usage is mainly for `node.js`, we decided to remove `process.env.STRAPI_URL` usage from default options in order to make this SDK compatible with way more Framework & Tools ([aaa162d](https://github.com/Stun3R/strapi-sdk-js/commit/aaa162d53bc656a149da8d2aacc9560a42a11d55))
+
+## v2.1.3
+
+#### ๐ Bug Fixes
+
+* **deps:** pin dependencies ([2e6e5a9](https://github.com/Stun3R/strapi-sdk-js/commit/2e6e5a984e3c3bce226bdb0a55218d6707cc0488))
+* **deps:** update dependency @nuxt/content-theme-docs to v0.11.1 ([1541e39](https://github.com/Stun3R/strapi-sdk-js/commit/1541e392bb9e70ee7cdc65fa1362358518c0d084))
+* **deps:** update dependency axios to ^0.24.0 ([4e2a41d](https://github.com/Stun3R/strapi-sdk-js/commit/4e2a41d5a3ffca07cf502d488ce9caea809f4bbc))
+
+## v2.1.2
+
+#### ๐ Bug Fixes
+
+* **params:** change type to accept object for populate ([bfa835c](https://github.com/Stun3R/strapi-sdk-js/commit/bfa835c6d01425049f7d675f96316516d59bca5d)), closes [#108](https://github.com/Stun3R/strapi-sdk-js/issues/108)
+
+
+#### ๐Docs
+
+* add integrations ([439b292](https://github.com/Stun3R/strapi-sdk-js/commit/439b2926e474c06a0e581f9af7c1ad08c5eb7282))
+
+## v2.1.1
+
+#### ๐ Docs
+
+* update link to follow **v4** latest changes
+
+## v2.0.0-beta.2
+
+#### ๐ Features
+
+* **chore**: Support of Strapi v4 #76
+* **request**: v4 error handling support ([4d0eb3f](https://github.com/Stun3R/strapi-sdk-js/commit/4d0eb3f50ed9796e7dd3837cd45a2d926e9679d5))
+* **types**: handling new types based on Strapi v4 (`StrapiError`, `StrapiLocale`, `StrapiResponse`, `StrapiRequestParams`...)
+
+#### โป๏ธ Refactor
+
+* **params**: `_locale` query param is now `locale`
+
+#### ๐ฅ**BREAKING CHANGES**
+
+* SDK supports Strapi v4. Every CRUD methods response changed & more. Please refer to [documentation](https://strapi-sdk-js.netlify.app)
+* GraphQL is no longer supported since v1.1.0
+
+## v1.1.0
+
+#### ๐ Bug Fixes
+
+* **request:** use AxiosError type on error ([1140bbb](https://github.com/Stun3R/strapi-sdk-js/commit/1140bbb990c37e492aa8d457a1e65ff5a0ac24ed))
+* **deps:** update dependency @types/js-cookie to v3 ([88483aa](https://github.com/Stun3R/strapi-sdk-js/commit/88483aa0ff841c440716bbe1014ff8a6ef58c27f))
+* **deps:** update dependency axios to ^0.23.0 ([854e84e](https://github.com/Stun3R/strapi-sdk-js/commit/854e84e02cdb818a69dddfecb8c1530f791609c4))
+
+#### โป๏ธ Code Refactoring
+
+* **methods:** drop of graphql support ([eebd7a3](https://github.com/Stun3R/strapi-sdk-js/commit/eebd7a34ddbce216ba0e8b3f5a3f95c0a0a5add5))
+
+
+#### ๐ฅ BREAKING CHANGES
+
+* GraphQL is no longer supported in v1.1.0
+
+## v1.0.2
+
+#### ๐ Bug Fixes
+
+* **deps:** update dependency js-cookie to v3 ([54be993](https://github.com/Stun3R/strapi-sdk-js/commit/54be993f1c02949fb320786bca409681eb6c9ed0))
+
+## v1.0.1
+
+#### ๐ Bug Fixes
+
+* **npm:** dist folder is missing when installing package ([8629d3d](https://github.com/Stun3R/strapi-sdk-js/commit/8629d3d85f399925f1697a5ab39881f47e1fe5fa)) @lhillebrandt
+* **dist:** change path in order to take dist inside npm package ([b494a35](https://github.com/Stun3R/strapi-sdk-js/commit/b494a352cb5559a8e9a2e2e931ee30a67836ef82))
+* **package.json:** remove trailing slash from dist folder in files ([7d3000c](https://github.com/Stun3R/strapi-sdk-js/commit/7d3000c15f63443d03971bc510cecf86ae530983))
+
+## v1.0.0
+
+#### ๐ Features
+
+* **user:** add user object, getter, setter & fetch methods ([e18089a](https://github.com/Stun3R/strapi-sdk-js/commit/e18089ae31446eeaff49c6e8a01250bc5cbe14ac))
+* **auth:** add auth & token methods ([a554ee9](https://github.com/Stun3R/strapi-sdk-js/commit/a554ee9930f3dc87e792afaba571e84143707528))
+* **core:** add crud methods, typescript support & graphql method ([cbe3b47](https://github.com/Stun3R/strapi-sdk-js/commit/cbe3b475dcdf49e3d6a37d594de2c69db8e185f3))
+
diff --git a/docs/content/en/api/methods.md b/docs/content/en/api/methods.md
deleted file mode 100644
index 65685f5e..00000000
--- a/docs/content/en/api/methods.md
+++ /dev/null
@@ -1,306 +0,0 @@
----
-title: Methods
-subtitle: "Discover how to use this beautiful SDK. ๐ฅ"
-description: "Discover how to use this beautiful SDK. ๐ฅ"
-position: 5
-category: "๐ฅ API"
----
-
-## CRUD
-
-### `find(contentType, params)`
-
-- Returns `Promise>`
-
-Get a list of content type entries matching the query filters. **Strapi v4** comes with brand new query filters, you can read more about it [here](https://strapi.io/documentation/developer-docs/latest/developer-resources/content-api/content-api.html#api-parameters) for available parameters.
-
-```js
-await strapi.find('restaurants', {
- filters: {
- name: {
- $eq: 'La Fourchette'
- }
- },
- sort: 'name:asc',
- pagination: {
- start: 0,
- limit: 0
- },
- fields: [...];
- populate: [...] ||ย '' ||ย {};
- publicationState: 'live';
- locale: 'all'
-})
-```
-
-> To know more about query filters type, see [here](types#strapirequestparams)
-
-### `findOne(contentType, id, params)`
-
-- Returns `Promise>`
-
-Get a specific content type entry by id. You can add query filters in order to select the returning `fields` & `populate` relations.
-
-```js
-await strapi.findOne('restaurants', 1)
-// with query filters
-await strapi.findOne('restaurants', 1, {
- fields: ['id', 'name']
- populate: ['menu'],
-})
-```
-
-> To know more about query filters type, see [here](types#strapibaserequestparams)
-
-### `create(contentType, data, params)`
-
-- Returns `Promise>`
-
-Create a content type entry and returns its value. You can add query filters in order to select the returning `fields` & `populate` relations.
-
-```js
-await strapi.create('restaurants', { name: '' })
-// with query filters
-await strapi.create('restaurants', 1, {
- fields: ['id', 'name']
- populate: ['menu'],
-})
-```
-
-> To know more about query filters type, see [here](types#strapibaserequestparams)
-
-### `update(contentType, id, data, params)`
-
-- Returns `Promise>`
-
-Update a content type entry by id. It returns the updated entry. You can add query filters in order to select the returning `fields` & `populate` relations.
-
-```js
-await strapi.update('restaurants', 1, { name: '' })
-// with query filters
-await strapi.update('restaurants', 1, {
- fields: ['id', 'name']
- populate: ['menu'],
-})
-```
-
-> To know more about query filters type, see [here](types#strapibaserequestparams)
-
-### `delete(contentType, id, params)`
-
-- Returns `Promise>`
-
-Delete a content type entry by id. It returns the deleted entry. You can add query filters in order to select the returning `fields` & `populate` relations.
-
-```js
-await strapi.delete('restaurants', 1)
-// with query filters
-await strapi.delete('restaurants', 1, {
- fields: ['id', 'name']
- populate: ['menu'],
-})
-```
-
-> To know more about query filters type, see [here](types#strapibaserequestparams)
-
-## Authentication
-
-### `register(data)`
-
-- Returns `Promise`
-
-Register a new [User](properties#user) & sets the [Token](methods#settokentoken).
-
-```js
-await strapi.register({ username: "", email: "", password: "" });
-```
-
-> See the [Strapi documentation](https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#registration).
-
-### `login(data)`
-
-- Returns `Promise`
-
-Authenticate a [User](properties#user) & sets the [Token](methods#settokentoken).
-
-```js
-await strapi.login({ identifier: "", password: "" });
-```
-
-> See the [Strapi documentation](https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#login).
-
-### `changePassword(data)`
-
-- Returns `Promise`
-
-Changes the password for the currently logged in user.
-
-```js
-await strapi.changePassword({ currentPassword: "", password: "", passwordConfirmation: "" })
-```
-
-
-This method is new in **Strapi 4.3.3**.
-
-
-### `forgotPassword(data)`
-
-- Returns `Promise`
-
-Send an email to a user in order to reset his password.
-
-```js
-await strapi.forgotPassword({ email: "" });
-```
-
-> See the [Strapi documentation](https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#forgotten-reset-password).
-
-### `resetPassword(data)`
-
-- Returns `Promise`
-
-Reset the user password & sets the [Token](methods#settokentoken)
-
-```js
-await strapi.resetPassword({
- code: "",
- password: "",
- passwordConfirmation: "",
-});
-```
-
-> See the [Strapi documentation](https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#forgotten-reset-password).
-
-### `sendEmailConfirmation(data)`
-
-- Returns `Promise`
-
-Send programmatically an email to a user in order to confirm his account.
-
-```js
-await strapi.sendEmailConfirmation({ email: "" });
-```
-
-> See the [Strapi documentation](https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#email-validation).
-
-### `getProviderAuthenticationUrl(provider)`
-
-- Returns `string`
-
-Get the correct URL of the provider's authentication page to authenticate with it.
-
-```js
-strapi.getProviderAuthenticationUrl("provider");
-```
-
-> For the list of all providers, see [Strapi documentation](https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#providers).
-
-### `authenticateProvider(provider, access_token)`
-
-- Returns `Promise`
-
-Once authorized, the provider will **redirects the user to your app with an access token in the URL**. The `access_token` parameter is not needed if you have it in your URL redirection but you can provide one.
-
-```js
-await strapi.authenticateProvider("provider");
-// OR
-await strapi.authenticateProvider("provider", "myAccessToken");
-```
-
-> For the list of all providers, see [Strapi documentation](https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#providers).
-
-### `logout()`
-
-It will log out the user by removing authentication token from the [chosen storage](options#store) & `axios header`.
-
-```js
-strapi.logout();
-```
-
-### `setUser(user)`
-
-Set local data of the logged-in user
-
-```js
-strapi.setUser(user);
-```
-
-
-
-This method is no longer supported in **v2.2.0 & newer** since `getter` & `setter` for `user` properties has been removed.
-
-
-
-You can use `strapi.user` in order to set user data and get it.
-
-### `fetchUser()`
-
-- Returns `Promise`
-
-You often need to fetch your user data. Use this method to fetch the current user from `/users/me` if a `JWT` is present in your [storage](options#store). It sets the [User](properties#user).
-
-```js
-await strapi.fetchUser();
-```
-
-### `getToken()`
-
-v2.2.0+
-
-- Returns `string | null`
-
-Retrieve your JWT token from [chosen storage](options#store)
-
-```js
-strapi.getToken();
-```
-
-### `setToken(token)`
-
-Set your JWT token in Axios headers as a `Bearer` JWT & store it in [chosen storage](options#store).
-
-```js
-strapi.setToken(token);
-```
-
-
-
-Since **v2.2.0 & newer** it only set token in your chosen storage. We now use [axios interceptors](https://axios-http.com/docs/interceptors) to synchronize token in header.
-
-
-
-### `removeToken()`
-
-Remove your JWT token from Axios headers & [chosen storage](options#store).
-
-```js
-strapi.removeToken();
-```
-
-
-
-Since **v2.2.0 & newer** it only set token in your chosen storage. We now use [axios interceptors](https://axios-http.com/docs/interceptors) to synchronize token in header.
-
-
-
-## Extends
-
-### axios
-
-This SDK uses `axios` under the hood, you can access the `axios` instance directly from there:
-
-```js
-strapi.axios;
-```
-
-OR if you defined custom routes in your Strapi API that go out of the REST scope or if you want to extend the `axios request config`, you can do as below::
-
-```js
-const response = await strapi.request("get", "/restaurants", {
- headers: {
- foo: "bar",
- },
-});
-```
-
-> See the [axios config](https://github.com/axios/axios#request-config)
diff --git a/docs/content/en/api/options.md b/docs/content/en/api/options.md
deleted file mode 100644
index a11fc8b8..00000000
--- a/docs/content/en/api/options.md
+++ /dev/null
@@ -1,68 +0,0 @@
----
-title: Options
-subtitle: "Learn how to configure your Strapi SDK. ๐ฅ"
-description: "Learn how to configure your Strapi SDK. ๐ฅ"
-position: 6
-category: "๐ฅ API"
----
-
-## `url`
-
-- Type: `string`
-- Default: `process.env.STRAPI_URL || http://localhost:1337`
-
-URL of the Strapi server.
-
-Environment variable `STRAPI_URL` can be used to override `url`.
-
-
-
-Since **v2.1.4** `process.env.STRAPI_URL` is not taken by default.
-
-
-
-## `prefix`
-
-- Type: `string`
-- Default: `/api`
-
-In **Strapi v4** you are able to change the prefix of API endpoint. By default it is `/api` in order to request your API on `http://localhost:1337/api` but you can configure depends on your needs.
-
-> To see how to configure it on Strapi, see [API configuration](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/api.html#api-configuration)
-
-## `store`
-
-- Type: `StoreConfig`
-
-Store's configuration in order to set `key` for the cookie name as well as localStorage key if you choose to use it thanks `useLocalStorage`. Finally you can give some `cookieOptions` to forward to the [js-cookie](https://github.com/jshttp/cookie#options-1) package.
-
-- `key`
- - Type: `string`
- - Default: `strapi_jwt`
-- `useLocalStorage`
- - Type: `boolean`
- - Default: `false`
-- `cookieOptions`
- - Type: `object`
- - Default: `{ path: "/" }`
-
-**Example**
-
-```js
-import Strapi from "strapi-sdk-js";
-
-const strapi = new Strapi({
- store: {
- key: "strapi_jwt",
- useLocalStorage: false,
- cookieOptions: { path: "/" },
- },
-});
-```
-
-## `axiosOptions`
-
-- Type: `AxiosRequestConfig`
-- Default: `{}`
-
-Options to forward to the [Axios instance](https://github.com/axios/axios#request-config)
diff --git a/docs/content/en/api/properties.md b/docs/content/en/api/properties.md
deleted file mode 100644
index b1f3cfc3..00000000
--- a/docs/content/en/api/properties.md
+++ /dev/null
@@ -1,30 +0,0 @@
----
-title: Properties
-subtitle: "Here are the properties you can access. ๐ฅ"
-description: "Here are the properties you can access. ๐ฅ"
-position: 4
-category: "๐ฅ API"
----
-
-## `user`
-
-This object contains details about authenticated user. You can access it using `strapi`.
-
-```js
-// get
-strapi.user;
-// set user data
-strapi.user.avatar = "";
-```
-
-## `axios`
-
-You have access to the axios instance thanks `strapi.axios`. It allow you to set new headers or extend it:
-
-```js
-strapi.axios.defaults.headers.common["Authorization"] = `Bearer myToken`;
-```
-
-Note that we use [axios interceptors](https://axios-http.com/docs/interceptors) in order to synchronize your JWT token in header.
-
-> See [Axios documentation](https://github.com/axios/axios)
diff --git a/docs/content/en/api/types.md b/docs/content/en/api/types.md
deleted file mode 100644
index 163e2964..00000000
--- a/docs/content/en/api/types.md
+++ /dev/null
@@ -1,219 +0,0 @@
----
-title: Types
-subtitle: "Because this package has been designed using Typescript, it natively supports it. ๐ฅ"
-description: "Because this package has been designed using Typescript, it natively supports it. ๐ฅ"
-position: 7
-category: "๐ฅ API"
----
-
-## Axios
-
-Here is the list of all `axios` interfaces & types used in this package:
-
-- `AxiosInstance` used for the `strapi.axios` property
-- `AxiosRequestConfig` used for the [axiosOptions](options#axiosoptions) in the `Strapi Constructor` and the custom request
-- `Method` (which is a `type`) used for the parameter `method` in the custom [request method](methods#request).
-
-## Custom
-
-Here is a list of all the custom types & interfaces present in this package.
-
-You can easily use them by importing them.
-
-**Example with `StrapiOptions`**
-
-```ts
-import Strapi, { StrapiOptions } from "strapi-sdk-js";
-
-const options: StrapiOptions = {
- url: "http://strapi-host/",
-};
-
-const strapi = new Strapi(options);
-```
-
-### `StrapiOptions`
-
-- Options in order to configure [new Strapi SDK instance](getting-started/usage#new-instance).
-
-```ts
-interface StrapiConfig {
- url?: string;
- store?: StoreConfig;
- axiosOptions?: AxiosRequestConfig;
-}
-```
-
-### `StoreConfig`
-
-- Used for [store](options#store) configuration in [Strapi SDK instanciation](getting-started/usage#new-instance).
-
-```ts
-interface StoreConfig {
- key: string;
- useLocalStorage?: boolean;
- cookieOptions?: CookieAttributes;
-}
-```
-
-### `StrapiBaseRequestParams`
-
-- Strapi query filters used in [findOne](methods#findOne), [create](methods#create), [update](methods#update), [delete](methods#delete) methods.
-
-```ts
-interface StrapiBaseRequestParams {
- fields?: Array;
- populate?: string | Array | Record;
-}
-```
-
-> To know more about how to use it, see [Strapi REST API](https://github.com/strapi/rfcs/blob/v4/rest-api/rfcs/xxxx-v4-rest-api.md#retrieving-data)
-
-### `StrapiRequestParams`
-
-- Strapi query filters used in [find](methods#findOne) methods.
-
-```ts
-interface StrapiRequestParams extends StrapiBaseRequestParams {
- sort?: string | Array;
- pagination?: PaginationByOffset | PaginationByPage;
- filters?: Record;
- publicationState?: "live" | "preview";
- _locale?: StrapiLocale;
-}
-```
-
-> To know more about how to use it, see [Strapi REST API](https://github.com/strapi/rfcs/blob/v4/rest-api/rfcs/xxxx-v4-rest-api.md#retrieving-data)
-
-### `PaginationByPage`
-
-- In Strapi v4, results can be paginated. Use the following types in [StrapiRequestParams](#StrapiRequestParams) in order to **paginate those results by page**.
-
-```ts
-interface PaginationByPage {
- page: number;
- pageSize: number;
- withCount?: boolean;
-}
-```
-
-### `PaginationByOffset`
-
-- In Strapi v4, results can be paginated. Use the following types in [StrapiRequestParams](#StrapiRequestParams) in order to **paginate those results by offset**.
-
-```ts
-export interface PaginationByOffset {
- start: number;
- limit: number;
- withCount?: boolean;
-}
-```
-
-### `StrapiLocale`
-
-- With this new version, we decided to give you access to all locales that are available in Strapi. This type is used in [StrapiRequestParams](#StrapiRequestParams) in order to **retrieve content by locale**.
-
-```ts
-export type StrapiLocale = | "af" | "af-NA" | "af-ZA" | "agq" ...
-```
-
-> See [full list of available locales](https://github.com/strapi/strapi/blob/master/packages/strapi-plugin-i18n/constants/iso-locales.json)
-
-### `StrapiResponse`
-
-- With Strapi v4 comes a new response object. Now you will have access a `data` object (the response data itself) & one `meta` object (information about pagination, publication state, available locales, etc).
-
-```ts
-export interface StrapiResponse {
- data: T;
- meta: Record;
-}
-```
-
-> To know more about how to use it, see [Strapi unified response format](https://github.com/strapi/rfcs/blob/v4/rest-api/rfcs/xxxx-v4-rest-api.md#fetching-entities)
-
-### `StrapiAuthProvider`
-
-- Used for `provider` parameter in [getProviderAuthenticationUrl](methods#getproviderauthenticationurlprovider) & [authenticateProvider](methods#authenticateproviderprovider-access_token) methods.
-
-```ts
-type StrapiAuthProvider =
- | "github"
- | "facebook"
- | "google"
- | "cognito"
- | "twitter"
- | "discord"
- | "twitch"
- | "instagram"
- | "vk"
- | "linkedin"
- | "reddit"
- | "auth0";
-```
-
-### `StrapiAuthenticationResponse`
-
-- Return object type in [register](methods#registerdata), [login](methods#logindata), [resetPassword](methods#resetpassworddata) & [authenticateProvider](methods#authenticateproviderprovider-access_token) methods.
-
-```ts
-interface StrapiAuthenticationResponse {
- user: Record;
- jwt: string;
-}
-```
-
-### `StrapiAuthenticationData`
-
-- Used for `data` parameter in [login](methods#logindata) method.
-
-```ts
-interface StrapiAuthenticationData {
- identifier: string;
- password: string;
-}
-```
-
-### `StrapiRegistrationData`
-
-- Used for `data` parameter in [register](methods#registerdata) method.
-
-```ts
-interface StrapiRegistrationData {
- username: string;
- email: string;
- password: string;
-}
-```
-
-### `StrapiForgotPasswordData`
-
-- Used for `data` parameter in [forgotPassword](methods#forgotpassworddata) method.
-
-```ts
-interface StrapiForgotPasswordData {
- email: string;
-}
-```
-
-### `StrapiResetPasswordData`
-
-- Used for `data` parameter in [resetPassword](methods#resetpassworddata) method.
-
-```ts
-interface StrapiResetPasswordData {
- code: string;
- password: string;
- passwordConfirmation: string;
-}
-```
-
-### `StrapiEmailConfirmationData`
-
-- Used for `data` parameter in [sendEmailConfirmation](methods#sendemailconfirmationdata) method.
-
-```ts
-interface StrapiEmailConfirmationData {
- email: string;
-}
-```
diff --git a/docs/content/en/getting-started/installation.md b/docs/content/en/getting-started/installation.md
deleted file mode 100644
index 61bd53f5..00000000
--- a/docs/content/en/getting-started/installation.md
+++ /dev/null
@@ -1,54 +0,0 @@
----
-title: Installation
-description: "Discover how to setup this beautiful SDK. โจ"
-subtitle: "Discover how to setup this beautiful SDK. โจ"
-category: "๐ Getting Started"
-position: 2
----
-
-
-
-If you are using Strapi **v3**, check out [here](https://v1-strapi-sdk-js.netlify.app) the documentation of the SDK `v1`
-
-
-
-Add `strapi-sdk-js` dependency to your project:
-
-
-
-
-```bash
-yarn add strapi-sdk-js
-```
-
-
-
-
-```bash
-npm install --save strapi-sdk-js
-```
-
-
-
-
-Then you can create a new instance by importing `strapi-sdk-js` in your project:
-
-```js
-import Strapi from "strapi-sdk-js";
-
-const strapi = new Strapi();
-```
-
-## Configuration
-
-You can pass multiple options to the `constructor`:
-
-```js
-import Strapi from "strapi-sdk-js";
-
-const strapi = new Strapi({
- // Options
-});
-```
-
-See [options](/api/options) for available options.
diff --git a/docs/content/en/getting-started/usage.md b/docs/content/en/getting-started/usage.md
deleted file mode 100644
index aa5e8e6e..00000000
--- a/docs/content/en/getting-started/usage.md
+++ /dev/null
@@ -1,143 +0,0 @@
----
-title: Usage
-subtitle: "Learn how to use this SDK. ๐"
-description: "Learn how to use this SDK. ๐"
-position: 3
-category: "๐ Getting Started"
----
-
-## New instance
-
-Here is how you can instantiate the Strapi SDK. **_Note that the displayed options are the default ones._** ๐
-
-```js
-import Strapi from "strapi-sdk-js";
-
-const strapi = new Strapi();
-// OR with options
-const strapi = new Strapi({
- url: "http://localhost:1337",
- prefix: "/api",
- store: {
- key: "strapi_jwt",
- useLocalStorage: false,
- cookieOptions: { path: "/" },
- },
- axiosOptions: {},
-});
-```
-
-> See [options](/api/options) for available options.
-
-## Content Types
-
-All contentTypes methods are built around the default Strapi CRUD operations.
-
-- `find`
-- `findOne`
-- `count`
-- `create`
-- `update`
-- `delete`
-
-```js
-await strapi.find("restaurants", { ...params });
-```
-
-> See more in [Methods](/api/methods)
-
-## Authentication
-
-Here are the methods in order to handle authentication in your application:
-
-### Register
-
-```js
-const { user, jwt } = await strapi.register({
- email: "",
- username: "",
- password: "",
-});
-```
-
-### Login
-
-```js
-const { user, jwt } = await strapi.login({ identifier: "", password: "" });
-```
-
-### Logout
-
-```js
-strapi.logout();
-```
-
-### Forgot Password
-
-```js
-await strapi.forgotPassword({ email: "" });
-```
-
-### Reset Password
-
-```js
-const { user, jwt } = await strapi.resetPassword({
- code: "",
- password: "",
- passwordConfirmation: "",
-});
-```
-
-### Email Confirmation
-
-```js
-await strapi.sendEmailConfirmation({ email: "" });
-```
-
-### Get Auth Provider URL
-
-```js
-window.location = strapi.getAuthenticationProvider("provider");
-```
-
-> See [providers list](https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#providers)
-
-### Authenticate Provider
-
-```js
-await strapi.authenticateProvider("provider", "access_token");
-// OR with params query
-await strapi.authenticateProvider("provider");
-```
-
-> See [providers list](https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#providers)
-
-## User
-
-Once you're logged in, you can access the `user` object which contains details about authenticated user:
-
-```js
-strapi.user;
-```
-
-## Advanced
-
-### Accessing axios
-
-This SDK uses `axios` under the hood, you can access the `axios` instance directly from there:
-
-```js
-strapi.axios;
-```
-
-OR if you defined custom routes in your Strapi API that go out of the REST scope or if you want to extend the `axios request config`, you can do as below::
-
-```js
-const response = await strapi.request("get", "/restaurants", {
- headers: {
- foo: "bar",
- },
-});
-```
-
-> See the [axios config](https://github.com/axios/axios#request-config)
diff --git a/docs/content/en/going-further/cli.md b/docs/content/en/going-further/cli.md
deleted file mode 100644
index 24ddfe8a..00000000
--- a/docs/content/en/going-further/cli.md
+++ /dev/null
@@ -1,81 +0,0 @@
----
-title: Command Line Interface (CLI)
-menuTitle: Command Line Interface
-subtitle: "Generate Typescript's Types based on your Strapi content types. ๐ก"
-description: "Generate Typescript's Types based on your Strapi content types. ๐ก"
-position: 8
-category: "๐ก Going Further"
-features:
- - Generate Typescript's types based on your content types
- - Usage of GraphQL Code Generator to generate types
- - Ease-of-use thanks a beautiful prompt
----
-
-
-
-Please note that **this library only works with Strapi v3**.
-
-
-
-## Features
-
-
-
-## Getting started
-
-### โณ Installation
-
-You can easily install this CLI thanks your favorite package manager:
-
-
-
-
- ```bash
- yarn add strapi-generate-types
- ```
-
-
-
-
- ```bash
- npm install --save strapi-generate-types
- ```
-
-
-
-
-### ๐ Requirements
-
-In order to use this generator you must have installed the GraphQL plugin **on your Strapi API**.
-
-```bash
-yarn strapi install graphql
-```
-> For more informations see the [GraphQL plugin](https://docs-v3.strapi.io/developer-docs/latest/development/plugins/graphql.html#graphql)
-
-### ๐น Usage
-The usage depend on which package manager you're using:
-
-
-
-
- ```bash
- yarn strapi-generate-types generate
- ```
-
-
-
-
- ```bash
- npx strapi-generate-types generate
- ```
-
-
-
-
-The prompt will ask you 3 things:
- 1. First, the host of your Strapi API with which you want to generate your types (default: `http://localhost:1337`).
- 2. Then, where you want to generate it (default: `./models/`).
- 3. Finally, the name of the file which will be generated (default: `types.ts`)
-
-Enjoy ๐
\ No newline at end of file
diff --git a/docs/content/en/going-further/handling-errors.md b/docs/content/en/going-further/handling-errors.md
deleted file mode 100644
index f1d09806..00000000
--- a/docs/content/en/going-further/handling-errors.md
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: Handling Errors
-subtitle: "Discover how to handle errors from Strapi. ๐ก"
-description: "Discover how to handle errors from Strapi. ๐ก"
-position: 9
-category: "๐ก Going Further"
----
-
-Thanks to **Strapi v4**, handling errors is no longer a huge waste of time ๐๐ป
-You have now a well formated error object that has the follwing format:
-
-```js
-{
- data: null,
- error: {
- status: "", // HTTP status
- name: "", // Strapi error name ('ApplicationError' or 'ValidationError')
- message: "", // A human reable error message
- details: {
- // error info specific to the error type
- }
- }
-}
-```
-
-> To know more about it, see [Strapi Error Handling](https://docs.strapi.io/developer-docs/latest/developer-resources/error-handling.html#rest-errors)
diff --git a/docs/content/en/going-further/integrations.md b/docs/content/en/going-further/integrations.md
deleted file mode 100644
index 0b15b14d..00000000
--- a/docs/content/en/going-further/integrations.md
+++ /dev/null
@@ -1,60 +0,0 @@
----
-title: Integrations
-subtitle: "How to use this SDK within your favorite Framework. ๐"
-description: "How to use this SDK within your favorite Framework. ๐"
-position: 10
-category: "๐ก Going Further"
----
-
-## Nuxt 2
-
-In order to use `Strapi SDK` globally you have to setup a `plugin` & add it into the `nuxt.config.js` file:
-
-```js [~/plugins/strapi.js]
-import Strapi from "strapi-sdk-js";
-
-export default ({ app }, inject) => {
- const strapi = new Strapi({
- // options
- });
-
- inject("strapi", strapi);
-};
-```
-
-```js [nuxt.config.js]
-export default {
- // ...
- plugins: ["~/plugins/strapi"],
-};
-```
-
-You can now use it globally thanks `this.$strapi` in components & `app.$strapi` in `asyncData` function.
-
-## Nuxt 3
-
-Unlike **Nuxt 2**, you will only have to setup a `plugin` and then you will just have to retrieve `$strapi` from `useNuxtApp` everywhere you want to use it:
-
-```js [~/plugins/strapi.js]
-import { defineNuxtPlugin } from "#app";
-import Strapi from "strapi-sdk-js";
-
-export default defineNuxtPlugin(() => {
- const strapi = new Strapi({
- // options
- });
- return {
- provide: {
- strapi,
- },
- };
-});
-```
-
-```js
-
-```
diff --git a/docs/content/en/index.md b/docs/content/en/index.md
deleted file mode 100644
index 06c95bad..00000000
--- a/docs/content/en/index.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: Introduction
-description: "This Strapi SDK will allow you to trigger easily your Strapi API"
-category: ''
-position: 1
-features:
- - Supports Strapi v4
- - RESTful methods
- - Simplified request responses
- - Formatted error handling
----
-
-
-
-
-Thanks this SDK you can trigger your [Strapi](https://strapi.io) API in your **Javascript**/**Typescript** project.
-
-## Features
-
-
-
-
-