netlify / addons Goto Github PK
View Code? Open in Web Editor NEWNetlify add-on documentation
Netlify add-on documentation
This is an issue generated by (for-internal-use-only)github-tools
This repository has exceeded the development grace period, and the repo owner must decide if branch protections should be enforced.
If this repository houses code used in production in any capacity, branch protections must be enforced. Read (for-internal-use-only)here for more details
Split out from another issue, so it doesn't block that one.
"In docs-driven dev style, @DavidWells will write draft docs in Coda to spec out the desired partner workflow (which depends on some API changes). As these are implemented, they can be added to the readme above."
Todo update https://docs.google.com/document/d/14hIisP4dSgTAqhcjD_Khj5PWKpni4jEsq4ussqkwoHA/edit# and add to repo with an example.
Note: this is effectively the "reverse" of the normal add-on flow and is for specific user cases
https://github.com/netlify/addons#payload-from-netlify-1 this example payload from Netlify is the following:
{
// Unique ID generated by Netlify
uuid: '2e65dd70-523d-48d8-8826-a93229d7ec01',
account: '5902622bcf321c7359e97e52',
config: {
site_url: 'https://calling-site-from-netlify.netlify.com',
jwt: {
secret: 'xyz-netlify-secret'
},
// User defined configuration values
config: {
name: 'woooooo'
},
// Netlify Site id
site_id: '2e65dd70-523d-48d8-8826-a93229d7ec01',
// Your service ID slug
service_id: 'express-example',
service_instance: {
config: { name: 'woooooo' }
},
// If your add-on needs to trigger site rebuilds we will send a build hook
incoming_hook_url: 'https://api.netlify.com/build_hooks/123xyz'
}
}
this is unclear what is actually coming and what is just an example. in fact, by default, we don't pass most of them.
also, it's worth to mention that uuid
is actually site_id of the netlify, that'd be a useful information for some providers.
cc/ @rybit
I'm trying to avoid using Express as a dependency.
Is it a urlencoded format? I hope so, because that would be pretty easy to handle.
It'd be really nice if there was mock requests I could test against before deploying, to make sure it is correct.
@DavidWells can you elaborate on this? That page is not accessible to me.
@DavidWells can you add some context for this one (came from your note).
Based on some troubleshooting with a partner, @bettse identified a section of the repo README that seems to be incorrect:
Under "Registering your add-on", I believe this is inaccurate:
All requests from Netlify to your add-onβs management API will contain an
X-Nf-Sign
authorization header. You can verify request are coming from Netlify by verifying theX-Nf-Sign
header against your add-on secret.I think that requests to the add-on's management API have the
Authorization header
withbearer {service secret}
, and that the NON-management API requests (those that we proxy from/.netlify/{service slug}
) are the ones with thex-nf-sign
header.
While in there, it would be helpful to do a pass to check for broken links (for example, Eric noted the 'Getting started' link under https://github.com/netlify/addons#verification-with-jws).
Is your feature request related to a problem? Please describe.
When addons are created, updated, or deleted the user sees a generic message without additional context on what to do next.
Example CLI output with no additional context:
VGS needs to tell the user to complete some additional steps to finish setup and would like to log out instructions after creation/updating
A couple of addon providers have requested being able to show a message after netlify addons:create/update/delete
This would be an extra field passed back from their API in the provisioning calls. Example from create
{
// `id` (required) - A unique ID generated by you, for reference within your own API
id: uuid(),
+ message: "My custom message for the user to see in the CLI or the UI"
// `endpoint` (optional) - Proxied endpoint.
// This will be callable at https://user-netlify-site.com/.netlify/your-addon-namespace
endpoint: "https://my-endpoint.example.com",
/* `config` (optional) - This can return back exactly what was received in the POST request, or include additional fields or altered values. This should also be what is returned in response to a GET request to /instances/:id */
config: {},
// `env` (optional) - Environment Keys accessible by Netlify user in build context & in functions
env: {
'YOUR_SERVICE_API_SECRET': 'value'
},
// `snippets` (optional) - JS Snippet content to inject into the calling Netlify site
snippets: [
{
title: 'Snippet From Demo App',
position: 'head',
html: `<script>console.log("Hello from ${logValue}")</script>`
}
]
}
Add message
field to allowed values back from addon endpoints and pass those down to the client (CLI & UI)
Show message here in CLI https://github.com/netlify/cli/blob/master/src/commands/addons/create.js#L65
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.