v1.0.0

RecordSeek Developer Kit

Add a RecordSeek button to any web page with one script tag. Visitors click it and the RecordSeek share app opens with the source (and optionally a person) ready to save to FamilySearch, Ancestry or as a citation.

Quick start

<script src="https://recordseek.com/sdk/v1/recordseek.js" defer></script>

<div class="recordseek"></div>

That is all: with no attributes the button captures the current page like the RecordSeek browser extension does. Pass what you know with data-* attributes:

<div class="recordseek"
     data-first-name="Dovy" data-last-name="Paukstys" data-birth-date="1980"
     data-bg-color="#1f6f43" data-font-color="white" data-url="./"></div>

Versioned URLs

https://recordseek.com/sdk/v1/recordseek.jsMoving: always the latest 1.x release (bug fixes, no breaking changes).
https://recordseek.com/sdk/1.0.0/recordseek.jsPinned: never changes, so you can add a Subresource Integrity hash.
<script src="https://recordseek.com/sdk/1.0.0/recordseek.js"
        integrity="sha384-…" crossorigin="anonymous" defer></script>

Content-Security-Policy: allow script-src https://recordseek.com. The button is created with the DOM API (no inline scripts or styles from strings are executed), and the stylesheet is a plain <style> element; if your CSP forbids inline styles, set data-style="none" and style the button yourself.

Attributes

Attribute names are case- and dash-insensitive: data-first-name, data-firstName and data-first_name are the same. Unknown data-* attributes are ignored and never sent. Precedence for each field: explicit data-* > genscrape result > generic page scrape.

AttributeTypeAliasesDescription
data-urlSource—Page to cite. Relative values resolve against the current page. Default: scraped, else the current URL.
data-titleSource—Source title. Default: scraped, else the page title.
data-citationSource—Ready-made citation text. Default: scraped.
data-notesSource—Notes to attach. Default: selected text, else the page description.
data-tagsSource—Comma-separated tags.
data-given-namePersonfirstname first given forenameGiven (first) name of the person.
data-surnamePersonlastname last familynameSurname (family name).
data-genderPersonsexMale or Female.
data-birth-datePersondobBirth date, any format (for example 1980 or 12 Mar 1980).
data-birth-placePerson—Birth place.
data-death-datePersondodDeath date.
data-death-placePerson—Death place.
data-father-given-namePerson—Father's given name.
data-father-surnamePerson—Father's surname.
data-mother-given-namePerson—Mother's given name.
data-mother-surnamePerson—Mother's surname.
data-spouse-given-namePerson—Spouse's given name.
data-spouse-surnamePerson—Spouse's surname.
data-bg-colorButtonbg backgroundButton background (any CSS color); sets --recordseek-bg. Default #1f6f43.
data-font-colorButtoncolorButton text color (any CSS color); sets --recordseek-fg. Default #ffffff.
data-labelButtontext buttontextButton text. Default "RecordSeek".
data-sizeButton—sm, md (default) or lg.
data-shapeButton—rounded (default), pill or square.
data-icon-typeButtoniconcolor (default, full-color mark), white (single-color white mark) or none (text only).
data-icon-positionButton—start (default) or end.
data-classButton—Replaces the default button classes entirely (space-separated). Default styles then do not apply.
data-styleButton—none: do not inject the default stylesheet (you style .recordseek-button yourself).
data-partnerOther—Your short partner id (letters, digits, . _ -), used for attribution.
data-scrapeOther—Set to false to disable automatic page scraping for this button.

Automatic scraping

By default the kit reads the current page the way the RecordSeek extension does: url, a title (the first <h1> when it is longer than the document title), a citation (first paragraph of an element with class citation), and notes (the visitor’s selected text, else the meta/Open Graph description). On genealogy sites it recognizes, a separate genscrape.js (loaded lazily from the same folder as recordseek.js) also extracts the person, relatives and facts:

On other sites only the generic scrape applies, so for best results pass person data with data-* attributes. Set data-scrape="false" to turn all scraping off for a button. If the scrape is slower than 2.5 seconds the popup opens anyway with what is available.

Styling

The button is a normal <button type="button"> inside your element, with these classes:

The default stylesheet (<style id="recordseek-sdk-style">, injected once) wraps every selector in :where(), so it has zero specificity: any rule of yours wins, no !important needed. It reads two CSS variables, --recordseek-bg and --recordseek-fg, which data-bg-color and data-font-color set on the button.

.recordseek-button { background: navy; border-radius: 2px; font-family: Georgia, serif; }

Other options: data-class="my-btn other" replaces the default classes entirely (the default styles then do not apply); data-style="none" or window.RecordSeekConfig = { injectStyles: false } skips injecting the stylesheet. Icons: data-icon-type color (default), white or none; data-icon-position start or end. All icons are inline SVG, with no network requests; the logo files are also published as recordseek-mark.svg and recordseek-mark-white.svg.

JavaScript API

RecordSeek.version            // "1.0.0"
RecordSeek.scan(root?)        // render buttons under root (idempotent); runs automatically on load and for added elements
RecordSeek.button(el, data?)  // render a button in one element
RecordSeek.open({ givenName: 'Jane', surname: 'Doe', url: location.href })  // open RecordSeek programmatically

// optional, before the script loads:
window.RecordSeekConfig = { base: 'http://localhost:9000/', partner: 'my-site', injectStyles: true };

The script never throws into your page.

Playground

Privacy

The script sets no cookies, uses no storage and loads no trackers on your page. Nothing is sent to RecordSeek until a visitor clicks the button; then the share app opens with the captured source, any person details you provided, and a small attribution (the SDK version, your site’s hostname and optional partner id) so we can see which integrations are used.

Third-party licenses

genscrape.js is genscrape v1.5.2, © Justin York, MIT license (notice kept in the file).