Learn / Bird Integration series / Verify phone numbers at signup

Bird Integration Part 03

Verify phone numbers at signup

7:36 min

Our bird shop confirms orders by email and texts shipping updates — in part three it stops taking phone numbers on faith. New customers now prove their number with a one-time passcode before the account exists: one call to send the code, one call to check it, no OTP system to build, no codes to store. The coding agent writes the integration, and we break it on purpose to show why a wrong code isn't an error.

What we cover

  • Sending a one-time code during signup
  • Verifying the code a customer enters
  • What to do after the account is confirmed
Transcript

Auto-generated from the video.

Hey. And welcome back to another integration series, part three. In the first two series, we've integrated email and SMS notifications into our web web shop. And today we're going to be integrating Verify. So, we want to make sure that once a user creates an account on our Aviary Shop, that we can actually validate the user against the information that they've put in. And there's two ways to do this. We can either decide to build an entire logic flow ourselves, which is going to be quite uh difficult and quite tedious. Or we can actually make use of the Verify platform within Bird.

So, Verify allows us to actually run two APIs very efficiently. The first API is sending out a verification token. Bird will generate a unique token and send it over depending on the channel of choice. And then there's a second API where the user submits the token that they've just received, and we do the match-up with the actual token that has been sent.

During this entire process, Bird doesn't actually see the tokens that have been sent, so that's all behind the scenes. Um but it allows you to have an a clear verification process in place to make sure that you can authenticate your users. Now, when setting up Verify, um there's some important components that we need to go through before we actually start the integration. First, we're going to head to the country step. Just like what we have with SMS, is that there's country-specific enablements.

For Verify, we've enabled all countries by default, so that's different than for SMS where everything is turned off by default. Um and for now, we also want to just focus on the Netherlands. Um within your country, you have the option to select which verification models you want to support and in which order you want to start doing this.

So, for the Netherlands, I've just set up this as a starting, so we're going to start with a WhatsApp verification. We're not going to do SMS because we don't want that. Um and then we've got an alternative fallback as email. So, in this case, the verification goes out through WhatsApp. In the event that fails, we'll send an email instead with that verification token.

Then, when we go into the configuration, there's also a few configurations that we can set up. So, we've got the duration of validity. So, how long is the token actually valid for? Standard is 10 minutes. But, we're going to up that to 15 minutes cuz we're a web shop. We're not as strict. Then, we've got the maximum number of retries. So, how many retries does a user have before we actually just block them? Um this is to make sure that we don't over track your systems with hundreds and hundreds of attempts. And then, we've got a retry delay. So, actually after what time frame will the attempts trigger the next sequence?

Then, we've got some specific channel settings as well. So, it's important to note that both SMS and WhatsApp, we're actually going to be using a Bird verified sender. So, we're not going to enable you to use a custom sender because we're going to take care of the heavy lifting when it comes to sender ID registrations and everything.

Um so, for this, we have a predetermined sender called Authifly, which will basically be used as the sender for both WhatsApp and SMS verification tokens. Then, for email, we also have the option to use a shared sender or that we can actually use a specific. So, we're just going to use verify at Aviary Messaging, which is our custom domain for our shop.

Then lastly, what's always important is setting up an API key. So, I've already gone and created the API key specifically for verify, given it the scopes for email, SMS, and for actually for verify. So, it's a bit of a broader key, so do be mindful of that.

Now, just like last time, we're going to open up a fresh Claude session, and we're going to start integrating Verify. All righty. Uh welcome back. So, this integration took a bit longer than the one that we had for SMS and email. Um multiple APIs need to be set up. But all in all, it was done within uh 8 to 10 minutes. So, again, let's just have a quick look at everything that it did. I had a very straightforward question, implement verify using the Bird CLI.

Um so, it found out uh the information, had a clear picture of how to shop. Um it asked me which channels I wanted to prioritize. So, again, WhatsApp and email. Um then started designing the entire verification flow. So, in essence, it needed uh three specific packages. It needed to have uh the starting route, so that's actually the sending of the verification. Then it's the checking route, so that's checking the code against the sent code. Um and then actual registration page needed to be have updates to make sure that everything was tied together.

Um then it decided to go. So, oh, it also uh deliberately did the restrictions, so it won't actually copy the routes, but it will actually use the verification um routes. Now, then it started building. Um so, it created the different routes. So, this is the verify start route. So, here we can actually see exactly what was written out for um the send state.

Uh we've got the error messages implemented already. And then we've got the check state, which checks against the sent um server. So, we've got the timeout implemented automatically. We can customize the error messages as we wish, and then the actual verification step is happening right there as well.

Now, and then it did all of the checks so again, so my agent does verify everything, runs several checks, and updates all of the information. And here it's got an overview of everything that it actually implemented. So, the verification created and it sends the resends, the branches on success, and then the actual two-step sign-up detail.

And then the full verification. All right, so we're back in our webshop, and we're just going to fill out our phone number, create a quick password, and I'm going to send the verification token. So, the moment it's sent on WhatsApp, if it doesn't arrive, so the moment that it fails, we're going to go over into the fallback. But I've immediately received the Authifly verification token.

So, I'll just quickly show you how that looks like, so you see a few of my previous tests as well. Um the profile is Authifly, so that's just the authentication. Now, I've set it up that in the event that I incorrectly uh paste the code, I'm actually going to get that code is incorrect. So, it's four retries, and then we're going to go into the correct code.

And it's correctly verified, and my account has been created. I can see my recent orders. Um but that's it. That's Verify in a couple of minutes. Uh have a look at the documentation, go to mcp.bird.com, and uh I'll see you in the next one.

Start with one channel.
Add the others when you're ready.

A test API key is yours immediately. Production unlocks when you add a payment method and verify a sender.

Using Claude Code, Cursor, or Codex? Copy a setup prompt and your agent installs the Bird CLI and skills for you. Pick yours:

Cursor