Embed Script
All widgets require our embed script to be included on your page, preferrably in
the <head>, but it will work anywhere else as well. You only need to include
this script once per page, regardless of how many widgets you want to embed on
the page, and regardless of what type.
Put our embed script in your page’s <head>.
<script async src="https://www.pledge.to/embed/widget.js"></script>Partner Key
Section titled “Partner Key”When you sign up for a Pledge account, a partner key is generated for your
account. Some widgets, such as the
organization search form and in certain cases,
the donation form, require your partner key as a
parameter in their embed code. Replace [PARTNER KEY] in the code examples in
these guides with your partner key.
You can find your partner key in your Impact Hub, in the Pledge APIs -> Widgets section.
Partner Key vs. API Key
Section titled “Partner Key vs. API Key”Pledge uses two different credentials, each for a different purpose:
- Partner key — a client-side identifier embedded in your HTML. It tells our widgets which account to associate with. It is safe to include in your frontend code.
- API key — a secret used to authenticate server-side requests to the Pledge REST API. Keep this secret and never expose it in frontend code.