mirror of
https://github.com/strapi/strapi.git
synced 2025-08-31 20:33:03 +00:00
Create custom local providers
This commit is contained in:
parent
7fd4e2fd45
commit
db8fa6fd5d
@ -88,3 +88,26 @@ In the `send` function you will have access to:
|
||||
|
||||
- `config` that contain configuration you setup in your admin panel
|
||||
- `options` that contain option your send when you called the `send` function from the email plugin service
|
||||
|
||||
To use it you will have to publish it on **npm**.
|
||||
|
||||
### Create a local provider
|
||||
|
||||
If you want create your own provider without publishing it on **npm** you can follow these following steps:
|
||||
|
||||
- You create a `providers` folder in your application.
|
||||
- Create your provider as explain in the documentation eg. `./providers/strapi-provider-email-[...]/...`
|
||||
- Then update your `package.json` to link your `strapi-provider-email-[...]` dependency to the [local path](https://docs.npmjs.com/files/package.json#local-paths) of your new provider.
|
||||
|
||||
```json
|
||||
{
|
||||
...
|
||||
"dependencies": {
|
||||
...
|
||||
"strapi-provider-email-[...]": "file:providers/strapi-provider-email-[...]",
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- Finally, run `yarn install` or `npm install` to install your new custom provider.
|
||||
|
@ -293,3 +293,26 @@ Then, visit [http://localhost:1337/admin/plugins/upload/configurations/developme
|
||||
## Create providers
|
||||
|
||||
If you want to create your own, make sure the name starts with `strapi-provider-upload-` (duplicating an existing one will be easier to create), modify the `auth` config object and customize the `upload` and `delete` functions.
|
||||
|
||||
To use it you will have to publish it on **npm**.
|
||||
|
||||
### Create a local provider
|
||||
|
||||
If you want create your own provider without publishing it on **npm** you can follow these following steps:
|
||||
|
||||
- You create a `providers` folder in your application.
|
||||
- Create your provider as explain in the documentation eg. `./providers/strapi-provider-upload-[...]/...`
|
||||
- Then update your `package.json` to link your `strapi-provider-upload-[...]` dependency to the [local path](https://docs.npmjs.com/files/package.json#local-paths) of your new provider.
|
||||
|
||||
```json
|
||||
{
|
||||
...
|
||||
"dependencies": {
|
||||
...
|
||||
"strapi-provider-upload-[...]": "file:providers/strapi-provider-upload-[...]",
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- Finally, run `yarn install` or `npm install` to install your new custom provider.
|
||||
|
Loading…
x
Reference in New Issue
Block a user