NFC templates
An NFC templateThe setup that decides what is written to a badge's NFC chip during check-in, such as the attendee's details or a link. NFC templates are created separately; check-in uses them to write the right data to each badge. decides what is written to the chip in an attendee’s badge when they check in. Check-in uses the template to write the right data to each badge. This page covers setting one up. For how encoding happens at the desk, see NFC badges.
Create an NFC template
Section titled “Create an NFC template”Choose the card formats, pick a write mode, define what gets written, and save.
Card formats
Section titled “Card formats”Choose which chip types this template supports. Each has a different usable capacity:
| Format | Usable capacity |
|---|---|
| NTAG213 | 144 bytes |
| NTAG215 | 504 bytes |
| NTAG216 | 888 bytes |
| Ultralight | 48 bytes |
| Classic 1K | 768 bytes |
| Classic 4K | 3456 bytes |
If a template supports several formats, what you write has to fit the smallest one. Writing more than the card holds is reported as an error rather than silently truncated.
Two ways to write
Section titled “Two ways to write”A template writes in one of two modes:
- NDEF (recommended). A standard, self-describing format that phones and readers understand out of the box. Choose this unless you have a specific reason not to.
- Hex (advanced). You control the exact bytes written to the chip. Use it only when you need a precise byte layout, for example to work with an existing access-control system.
NDEF records
Section titled “NDEF records”In NDEF mode a template is a list of records, each written to the chip in order. A new template starts with a Badge data record. The record types are:
- Badge data. The record EventDrake reads back to find this exact badge. The badge’s id is filled in when the card is written, so there is nothing to set. See The EventDrake records.
- Ticket data. A record that identifies the ticket rather than the badge. A card carrying it still finds the attendee, but a lost badge and its replacement read the same.
- Web link. A web address, such as a link to the attendee’s profile. You can pick a URI prefix (for example
https://) so the common part is not stored on the card. - Text. A plain text value, with a language tag (the default is English).
- Custom type. A custom record with a type name you choose, for your own integrations.
Each record other than Badge data and Ticket data takes a field value with an optional prefix and suffix.
When a record carries the ticket id (a Ticket data record, or a link or text from the ticket’s ID or public bio link), the editor warns: “Badges should usually carry the badge id instead of the ticket id, so a replaced badge can be told apart from its replacement.” Use Badge data instead.
The EventDrake records
Section titled “The EventDrake records”This is for readers who know NFC and want to understand how a badge is matched.
Both EventDrake records are NFC Forum external records with the same shape: one version byte (currently 0x01), followed by a 16-byte id written as raw bytes.
- Badge data: type name
eventdrake.net:badge, carrying the badge id. - Ticket data: type name
eventdrake.net:ticket, carrying the ticket id.
When a card is tapped, EventDrake first looks for a live badge written to that card at the event. Failing that, it reads the NDEF message: the first eventdrake.net:badge record finds the badge, an eventdrake.net:ticket record finds the ticket, and the text of a link or text record is tried as a badge code, for cards a supplier encoded in advance. Your own records are otherwise ignored for matching, so you can carry an EventDrake record and your own data on the same badge.
Field values and normalisation
Section titled “Field values and normalisation”For any record or replacement bound to a field, the value is worked out in this order:
- Read the field from the ticket or a related record.
- Normalise it with any normalisations you chose (see below).
- Wrap it with the prefix and suffix.
The normalisations are:
- Trim. Remove leading and trailing spaces.
- Uppercase or Lowercase. Change the case.
- Simplify accents. Convert accented letters to their nearest plain-ASCII form, so
JänebecomesJane. - Strip non-ASCII. Remove any character outside plain ASCII.
- Printable only. Remove non-printable characters.
Hex encoding
Section titled “Hex encoding”Hex mode is for expert use. You provide a base image of the card’s memory, then define one or more replacements that write a value into a fixed region.
Each replacement sets:
- Field, prefix, and suffix. The value to write, resolved as above.
- Offset and length. Where in the card’s memory the value goes, and how many bytes it occupies. The value must fit the length, or it is reported as an error.
- Encoding. How the value becomes bytes:
- ASCII / UTF-8: the characters as written.
- ASCII hex: the value’s characters as their hex digits.
- Raw binary: the value read as hex or a UUID and written as raw bytes (16 bytes for a UUID). The value must be valid hex.
- Length-prefixed UTF-8: a length byte followed by the UTF-8 bytes.
- Pad byte. What to fill the rest of the region with when the value is shorter than the length.
The finished image must fit the card, so keep the total within the capacity of the smallest supported format.
Which template applies
Section titled “Which template applies”Each template has a priority and a rule that decides which tickets it applies to. When more than one template could apply to a ticket, the highest priority wins. Because the rule matches on ticket fields, it is a ticket rule.
How it is used at check-in
Section titled “How it is used at check-in”During check-in the operator taps the badge and the template’s data is written. The write is confirmed, so a failure is reported at the desk. See NFC badges.