Skip to main content

Plug AI into Laifaxin

โฌ…๏ธ Coming from ยท Laifaxin path
  • Position: Outreach Overview โ†’ Connect Account โ†’ B2B Inquiry Workflow (this is the last step before outreach).
  • Time required: about 3 minutes the first time and less than 1 minute once familiar.

๐ŸŒŸ Goal: copy the accesstoken and current workspace orgId from a signed-in Laifaxin page so a trusted AI tool connects to the correct workspace. This page retrieves both connection values and runs a read-only check; it does not automatically search for prospects or send email.

Why You Need Bothโ€‹

When letting a local AI assistant operate Laifaxin on your behalf, neither credential can be omitted:

  • token (accesstoken) is your operational identity: it acts like a high-permission digital keycard. Only with it can the AI call backend APIs to query data, audit candidate companies, and save contacts under your name.
  • orgId is your exact workspace: a single account can hold personal spaces alongside multiple company team spaces. The orgId explicitly tells the AI which workspace to save contacts into and where to create outreach plans, preventing cross-space confusion.

A key without a room number (token with no orgId) leaves the AI unsure where to write data; a room number without a key (orgId with no token) leaves the AI unable to enter the system. With both in place, the AI can work accurately on your behalf.

Before Startโ€‹

Make sure that:

  1. you have opened and signed in to ๐Ÿ‘‰ Laifaxin on the web with Chrome or Edge;
  2. you have selected the exact personal or company workspace for this task from the avatar menu in the upper-right corner;
  3. if the B2B toolkit is not installed yet, first install it and run the health check, then return here. If it is already installed, open the original trusted local ZCode task.
Copy two values
  • accesstoken: the account credential (like an access card), usually a long string;
  • orgId: the current workspace ID (like the room you want to enter). A personal workspace may match the user ID, while a company workspace normally uses a different numeric value;
  • do not infer a company orgId from the middle of the token; use the orgId value stored by the browser;
  • retrieve both values again after switching personal accounts or company workspaces. Never send them to group chats, support tickets, public documents, or an untrusted shared AI task.

Choose Methodโ€‹

Your situationRecommended methodWhat it involves
First time, or code feels unfamiliarMethod 1: follow the interfaceFind both values without entering code
You want the faster pathMethod 2: one commandCopy both values once and paste the complete block into ZCode

Use Method 1 the first time. Method 2 is easier once you understand where both values come from.

Application Methodโ€‹

Open Developer Toolsโ€‹

Right-click a blank area of the signed-in Laifaxin page, then select Inspect.

If Inspect is not visible, press F12 on Windows or โŒฅ Option + โŒ˜ Command + I on Mac.

Open Applicationโ€‹

Select Application at the top of Developer Tools. If it is hidden, open the ยป overflow menu or additional tabs menu.

Select Local Storageโ€‹

Expand:

Storage
โ””โ”€โ”€ Local Storage
โ””โ”€โ”€ https://web.laifaxin.com

Then select https://web.laifaxin.com.

Copy accesstokenโ€‹

Find accesstoken in the Key column, then double-click the long string in its Value cell:

  1. press Ctrl + A, then Ctrl + C on Windows; press โŒ˜ Command + A, then โŒ˜ Command + C on Mac;
  2. return to the current trusted local ZCode task and send accesstoken=<the complete value you just copied>.

Laifaxin Application panel for copying the accesstoken by opening Inspect, selecting Application, expanding Local Storage for web.laifaxin.com, and copying the complete value on the right

Copy orgIdโ€‹

Return to the same table and enter orgId in the filter box:

  1. find the orgId row;
  2. copy the complete number or string from its Value cell;
  3. return to the same ZCode task and send orgId=<the complete value you just copied>.
Check both values
  • โœ… Copy the complete values beside accesstoken and orgId.
  • โŒ Do not copy only the key names or another row such as UserAtom.
  • โŒ Do not add quotation marks or spaces around either value, and do not truncate it.
  • The screenshot demonstrates the table location; every account has different values.

Method 2: One-Command Copyโ€‹

This is the faster path: one fixed command copies the accesstoken and current workspace orgId together.

Check before running the command
  1. Copy only the complete command shown on this page; never run unrelated code from an unknown source.
  2. The command only reads browser local storage and writes both values to your clipboard; it uploads nothing and does not modify Laifaxin data.
  3. Run it only on a signed-in web.laifaxin.com page.
  4. If the browser displays a paste warning, first verify that the command exactly matches this page, then follow the browser's visible instructions.

๐Ÿ’ก Why security rules are so strict: possessing your token is equivalent to having full operating permissions over your Laifaxin account (querying data and spending points to save contacts). Therefore, no matter who asks, never send the token to WeChat groups, support tickets, or public screenshots; the one-command snippet on this page only reads local browser storage and copies to your system clipboard entirely locally, sending no external network requests.

Open Consoleโ€‹

Right-click the Laifaxin page, select Inspect, then select Console at the top of Developer Tools.

Copy Both Valuesโ€‹

var t=localStorage.getItem("accesstoken");t&&t!=="null"?(copy("accesstoken="+t+"\norgId="+localStorage.getItem("orgId")),"โœ… ๅทฒๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ๏ผ่ฏทๅ›žๅˆฐๅฏน่ฏๆก† Ctrl+V ็ฒ˜่ดดๅ‘้€็ป™ AI"):"โŒ ๆœช็™ปๅฝ•ๆˆ–้กต้ขไธๅฏนโ€”โ€”่ฏทๅ…ˆ็™ปๅฝ• web.laifaxin.com ๅ†้‡่ฏ•";

Paste the command and press Enter:

  • โœ… ๅทฒๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ: the copy succeeded; return to the current ZCode task, paste, and send;
  • โŒ ๆœช็™ปๅฝ•ๆˆ–้กต้ขไธๅฏน: you are not signed in or are on the wrong page; verify the URL and sign-in state, then retry;
  • the pasted block should contain two lines beginning with accesstoken= and orgId=. Do not split it, remove the field names, or retype it manually; the current toolkit recognizes the complete block.
  • the current command directly returns the โœ… or โŒ message, with no extra undefined line.

Paste the Connection Blockโ€‹

With either method, place both accesstoken=... and orgId=... in the same trusted local ZCode task: Method 1 sends them as two separate messages, while Method 2 pastes the complete two-line block once. Then have the AI run the read-only login check first. The toolkit does not require a dedicated field named Laifaxin Token.

If you only run this connection test, clear both values when the test ends. If you immediately continue the complete workflow in the same trusted local task, they may be used temporarily for check_login.py, gate_check.sh, and later tools that genuinely require authentication. Never write them to files, runs/, logs, summaries, screenshots, backups, or migration packages, or echo the token in messages. Clear them when the workflow ends; retrieve them again after switching accounts, workspaces, login state, or tasks.

๐Ÿ’ก Delete the key when finished and retrieve it again next time you need it; grabbing it takes only 30 seconds.

Read-Onlyโ€‹

After both values are in the same ZCode task, send the instruction below. For Method 1, ZCode first combines the two labeled values into one two-line block; for Method 2, it uses the block you already pasted. ZCode runs the commands; you do not need to use a terminal:

Use the accesstoken=... and orgId=... values I just provided in this task. If I sent them separately, first combine them by field name into one two-line block. Do not echo the real values.

Run these checks in order and report in plain language:
1. Run tools/onboard_check.py and confirm that the environment passed.
2. Pass the complete two-line block to the credential input of tools/check_login.py (the current tool reads it via stdin using `--credentials-stdin`) so the tool can split accesstoken and orgId automatically. Report pass/fail and identify the current user and workspace separately without showing the token.
3. After login passes, run `bash tools/gate_check.sh` (without token or orgId arguments) per the gate contract in the current repository's RULES.md / SKILL.md, with you (the AI) handling credential passing internally. Report whether the general connection gate passed.

If this is only a connection test, clear the token and orgId when the checks end. If you immediately continue in the same trusted local task, they may be used temporarily by later tools that genuinely require authentication.
Do not write either value to files, runs, logs, message summaries, screenshots, backups, or migration packages, or echo the token; clear both when the workflow ends.
If any check fails, stop. Do not search or save prospects, generate templates, create sequences, add contacts, or activate sending.

Continue only after all three checks explicitly pass and the current user and workspace are correct.

Troubleshootโ€‹

Missing Appโ€‹

Open the ยป overflow menu or additional tabs menu. You can also make the Developer Tools panel wider.

No Storageโ€‹

Confirm that the current page is https://web.laifaxin.com and that your account is signed in. Refresh the page, then reopen Developer Tools.

Copy Troubleโ€‹

Use Method 2 instead. One command copies both values as an accesstoken= / orgId= two-line block; paste the complete block into ZCode.

Paste Blockedโ€‹

This is a browser safety warning intended to prevent malicious code. Do not disable browser security settings. First verify that the command exactly matches this page, then read and follow the instructions displayed by the browser.

Shows an Error or Includes nullโ€‹

If the console shows โŒ ๆœช็™ปๅฝ•ๆˆ–้กต้ขไธๅฏน, or the copied block contains orgId=null, the page did not provide complete connection details. Check that:

  1. the current site is web.laifaxin.com;
  2. your account is still signed in;
  3. you refreshed the page and ran the command again;
  4. if needed, you signed out and signed back in before retrying.

After Switchโ€‹

Yes. Run the one-command copy again after switching personal accounts or company workspaces because the orgId changes. Recopying the complete block avoids mixing an old workspace with the current account.

Advanced: alternative commands if the recommended command fails

Replace the key name in these examples with either accesstoken or orgId:

copy(window.localStorage.getItem("accesstoken"));

Use the browser clipboard API:

navigator.clipboard.writeText(localStorage.getItem("accesstoken"));

Read and display the value without copying it automatically:

localStorage.getItem("accesstoken");

The last command displays the complete value. Avoid using it while sharing or recording your screen.

๐Ÿ“‹ Connection Pitfallsโ€‹

PitfallConsequenceHow to avoid
๐Ÿ”ด Sending accesstoken to group chats, tickets, public docs, or untrusted AI tasksSomeone else can operate your Laifaxin accountSend it only to a trusted local ZCode task; do not echo it, write it to files, or screenshot it
๐Ÿ”ด Continuing after the read-only check failsLater searching and messaging fail or return errorsContinue only after all three checks explicitly pass and the user and workspace are correct
๐ŸŸก Reusing an old orgId after switching accounts or workspacesYou operate in the wrong workspace and data does not matchRecopy both values after every switch
๐ŸŸก Copying only the key name, or a truncated or quoted valueThe sign-in check fails, and it is easy to misread as a permission problemCopy the full value, without quotes, spaces, or truncation

๐Ÿ“š Further Readingโ€‹

๐Ÿš€ Next

๐Ÿ“„ Build a B2B Inquiry Workflow โ€” once the connection test passes, start here to pick a starting point and run outreach.