Choose a tool
Each Gatepost tool follows the same spec, so each one reads a postcode in the same way. Choose by the language of your app and by what it must know.
| You want to | Use | Needs a key |
|---|---|---|
| Check the form of a postcode in TypeScript or JavaScript | @gatepost/core |
no |
| Add a postcode field to an HTML form | @gatepost/field |
only to confirm |
| Add a postcode field to a React form | @gatepost/react |
only to confirm |
| Look up a postcode from a TypeScript server | @gatepost/client |
yes |
| Check or look up a postcode in PHP | gatepost/postcode |
only for lookups |
| Check postcodes in a WooCommerce checkout | Gatepost Postcode for WooCommerce | only for lookups |
What a check of the form tells you
Section titled “What a check of the form tells you”The core packages read the text that a user typed. They tell you whether the text has the form of a postcode, and what is wrong when it does not. They work offline, so they cost nothing and send nothing.
A postcode with the right form can still be wrong. Only NIPOST’s gateway knows which postcodes exist. Check the form first, and then ask the gateway when your app needs to know more.
Get a key
Section titled “Get a key”The gateway refuses every call without a key. Register on NIPOST’s dashboard to get one. NIPOST gives two kinds of key.
- A secret key starts with
nipost_test_ornipost_live_. Keep it on a server. - A publishable key starts with
nipost_pk_test_ornipost_pk_live_. A web page can hold it, but it works only from the addresses that you allow in the dashboard.
Test keys work only on NIPOST’s staging gateway. NIPOST’s docs do not give the address of the staging gateway. Ask NIPOST for it, and pass it as baseUrl. NIPOST’s docs explain the levels, the credits and the limits: docs.postcode.gov.ng.
Unofficial. Not made or endorsed by NIPOST.