Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
Check Facebook page inbox messages via Meta Business Suite browser automation. Use when asked to check Facebook messages, reply to FB customers, or manage Fa...
Check Facebook page inbox messages via Meta Business Suite browser automation. Use when asked to check Facebook messages, reply to FB customers, or manage Fa...
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
โ ๏ธ CRITICAL: Always use profile:"openclaw" (isolated browser) for all browser actions. Never use Chrome relay. Keep the same targetId across operations to avoid losing the tab. โ ๏ธ CONTEXT Management: Snapshot results are large. Do NOT repeat them in thinking. Extract needed info and process immediately. Preferred approach: Use snapshot refs:"aria" compact:true to find element refs, then act + click/type with ref.
Before first use, check if config.json exists: read file_path:"skills/meta-fb-inbox/config.json" โ ๏ธ PATH RULE: Always use workspace-relative paths starting from skills/meta-fb-inbox/. Never use ../ or absolute paths. If missing or empty, help the user run the setup wizard: cd skills/meta-fb-inbox node scripts/setup.js
config.json contains a pages array. Each page has an alias (display name) and url (Meta Business Suite inbox URL): { "pages": [ { "alias": "fb fanpage", "url": "https://business.facebook.com/latest/inbox/all/?&asset_id=123456789012345" }, { "alias": "fb fanpage 2", "url": "https://business.facebook.com/latest/inbox/all/?&asset_id=987654321098765" } ] }
When the user asks to check messages: If they specify an alias (e.g. "fb fanpage 2"), look it up in config.json โ pages. If they don't specify, use the first page in the array. If only one page exists, use it directly. If multiple pages exist and no alias given, list available aliases and ask which one.
This is the first step for all operations below. Check and start browser service: browser action:"status" If "running": false, start the browser service: browser action:"start" profile:"openclaw" Wait 2-3 seconds for the service to initialize. Read config to get the target page URL: read file_path:"skills/meta-fb-inbox/config.json" Resolve the page alias to a URL (see "Resolving a Page" above). Open browser: browser action:"open" profile:"openclaw" targetUrl:"<pageUrl>" Capture targetId and url from response. Wait for page load: browser action:"act" profile:"openclaw" targetId:"<targetId>" request:{"kind":"wait","timeMs":3000} Check login state: browser action:"act" profile:"openclaw" targetId:"<targetId>" request:{"kind":"evaluate","fn":"function(){return window.location.href;}"} If URL contains business.facebook.com and shows the inbox โ logged in, proceed. If redirected to a login page โ notify the user they need to log in manually in the OpenClaw browser, then retry. Proceed with the user's request. Clean Up Browser Tabs (after all operations): a. Open a blank tab: browser action:"open" profile:"openclaw" targetUrl:"about:blank" b. Get all tabs: browser action:"tabs" profile:"openclaw" c. Close all tabs except the newest one (about:blank): browser action:"close" profile:"openclaw" targetId:"<your_targetId>"
Complete flow: open page โ screenshot โ report. Read config: read file_path:"skills/meta-fb-inbox/config.json" โ resolve page URL Start browser if needed: browser action:"start" profile:"openclaw" Open page: browser action:"open" profile:"openclaw" targetUrl:<pageUrl> โ get targetId Wait: browser action:"act" profile:"openclaw" targetId:<targetId> request:{"kind":"wait","timeMs":4000} Check URL to verify login (see step 5 above) Take snapshot: browser action:"snapshot" profile:"openclaw" targetId:<targetId> refs:"aria" compact:true Look for conversation items in the inbox list. Each conversation typically shows: Customer name Last message preview Timestamp Unread indicator (bold text or dot) Report results in format: <name> (<time>) <preview> [ๆช่ฎ/ๅทฒ่ฎ] Clean up tabs. If the snapshot is hard to parse (Meta's DOM is complex), fall back to: browser action:"screenshot" profile:"openclaw" targetId:<targetId> Then describe what you see in the screenshot.
Follow "Enter Facebook Inbox" steps to get to the inbox page. Take a snapshot or screenshot to see the conversation list. Report conversations with name, time, preview, and read/unread status.
Why get URLs? Having the direct conversation URL lets you jump straight to a chat later without searching for it again. Saves time when replying. When to get URLs: After listing chats, get URLs for unread conversations or any conversation you might need to access again. ๐ Simple 3-Step Method: Click into the conversation using the customer name: browser action:"act" profile:"openclaw" targetId:"<targetId>" request:{"kind":"evaluate","fn":"function() { const containers = document.querySelectorAll('div[style*=\"position: absolute\"]'); for (let container of containers) { const nameEl = container.querySelector('div.x1vvvo52.x1fvot60.xxio538'); if (nameEl && nameEl.textContent.trim() === '<customer_name>') { nameEl.click(); return {clicked: true}; } } return {error: 'not found'}; }"} Replace <customer_name> with the actual customer name from your conversation list. Wait 2 seconds for page to load and URL to update: browser action:"act" profile:"openclaw" targetId:"<targetId>" request:{"kind":"wait","timeMs":2000} Get the current URL - it's automatically updated! browser action:"act" profile:"openclaw" targetId:"<targetId>" request:{"kind":"evaluate","fn":"function(){return window.location.href;}"} Store the URL alongside the chat info. โ Example URL Format: https://business.facebook.com/latest/inbox/all/?&asset_id=123456789012345&selected_item_id=1234567890&thread_type=FB_MESSAGE Or with optional mailbox_id: https://business.facebook.com/latest/inbox/all/?&asset_id=123456789012345&mailbox_id=123456789012345&selected_item_id=9876543210&thread_type=FB_MESSAGE ๐ Understanding the URL: asset_id = Your Facebook page ID (stays the same) selected_item_id = Unique conversation ID (different for each customer) thread_type=FB_MESSAGE = Messenger conversation type mailbox_id = Optional, may appear for some conversations ๐พ How to Use Later: Next time you need to access this conversation, skip all the searching: browser action:"navigate" profile:"openclaw" targetId:"<targetId>" targetUrl:"<saved_conversation_url>" Wait 2 seconds, and you're in the conversation! ๐ก Tip: Get URLs for unread messages during your check routine, store them in a file or memory, and reuse them for instant access. ๐ Getting Multiple URLs: If you need URLs for multiple conversations: Get URL for first conversation (steps 1-3 above) Navigate back to inbox list: browser action:"navigate" profile:"openclaw" targetId:"<targetId>" targetUrl:"<pageUrl>" Wait 2 seconds. Repeat for next conversation. Alternative method (when already in conversation): If you're already viewing a conversation and just need its URL, skip step 1 and directly run step 3 - the URL is already there!
โก Fast Path: If you have the conversation URL from "Get URLs for Conversations": browser action:"navigate" profile:"openclaw" targetId:"<targetId>" targetUrl:"<conversation_url>" Wait 2 seconds, then skip to step 3. Standard Path: From the inbox list, find and click the conversation (use snapshot + click by ref). Wait for messages to load (2-3 seconds). Take a screenshot to see the message thread. Report the messages with sender, time, and content.
To programmatically read messages: Navigate to the conversation (if not already there). Inject the read-messages script: browser action:"act" profile:"openclaw" targetId:"<targetId>" request:{"kind":"evaluate","fn":"<contents_of_scripts/read-messages.js>"} Read the script file: read file_path:"skills/meta-fb-inbox/scripts/read-messages.js" And pass its entire contents as the fn parameter (wrapped in parentheses). Parse the response: The script returns an array of message objects: [ {"text": "ไฝ ๅฅฝ", "isCustomer": true, "hasImage": false, "imageUrl": null}, {"text": "[Image]", "isCustomer": true, "hasImage": true, "imageUrl": "https://scontent-..."} ] Download images (if any): โ ๏ธ Default download location: ~/Downloads (do NOT clutter the workspace). For each message with hasImage: true: cd ~/Downloads curl -O "<imageUrl>" The downloaded file will use the original filename from the URL. If you want a custom filename: cd ~/Downloads curl -o "fb-message-$(date +%Y%m%d-%H%M%S).jpg" "<imageUrl>"
โก Fast Path (if you have conversation URL): If you already obtained the conversation URL from "Get URLs for Conversations" section, skip step 1 and go directly: browser action:"navigate" profile:"openclaw" targetId:"<targetId>" targetUrl:"<conversation_url>" Wait 2 seconds, then proceed to step 2 (Take snapshot to find input box). Standard Path (when you don't have the URL): Open the conversation: Click the customer name in the conversation list: browser action:"act" profile:"openclaw" targetId:"<targetId>" request:{"kind":"evaluate","fn":"function() { const containers = document.querySelectorAll('div[style*=\"position: absolute\"]'); for (let container of containers) { const nameEl = container.querySelector('div.x1vvvo52.x1fvot60.xxio538'); if (nameEl && nameEl.textContent.trim() === '<customer_name>') { nameEl.click(); return {clicked: true}; } } return {error: 'not found'}; }"} Replace <customer_name> with the actual customer name. Wait 2 seconds for the conversation to load. Take a snapshot to find the input box: browser action:"snapshot" profile:"openclaw" targetId:"<targetId>" refs:"aria" compact:true Look for textbox with [active] attribute. Type the reply message: browser action:"act" profile:"openclaw" targetId:"<targetId>" request:{"kind":"type","ref":"<input_ref>","text":"<your_message>"} After typing, wait 1 second for the send button to appear. Take another snapshot to find the send button: browser action:"snapshot" profile:"openclaw" targetId:"<targetId>" refs:"aria" compact:true Look for a new button near the textbox. The send button appears after you type text (it replaces the "like" button). Click the send button: browser action:"act" profile:"openclaw" targetId:"<targetId>" request:{"kind":"click","ref":"<send_button_ref>"} Verify the message was sent: Wait 2 seconds, then take a screenshot or check the conversation list to confirm the message appears.
โก Fast Path: If you have the conversation URL, navigate directly: browser action:"navigate" profile:"openclaw" targetId:"<targetId>" targetUrl:"<conversation_url>" Wait 2 seconds, then proceed to the label operations.
โก Fast Path: If you have the conversation URL, navigate directly: browser action:"navigate" profile:"openclaw" targetId:"<targetId>" targetUrl:"<conversation_url>" Wait 2 seconds, then proceed to the note operations.
Question: Do you need to ADD or EDIT a note? Take a snapshot of the conversation sidebar. Look for the Notes section (usually appears after Labels section). Check what you see: ONLY see a "Add note" type button/link (single button, no existing note text) โ Contact has NO note โ Use "Add a New Note" section below. See an "Edit" link + existing note text (usually with timestamp) โ Contact has existing note โ Use "Edit an Existing Note" section below. Simple rule: No note = Add new (only one button visible) Has note = Edit existing (edit link + note text visible) How to identify in snapshot: No note: Look for pattern like button [ref=eXXX] or link [ref=eXXX] with NO paragraph text nearby Has note: Look for pattern like link [ref=eXXX] (edit) + link [ref=eYYY] (delete) + paragraph [ref=eZZZ]: "note text"
If multiple pages are configured: Read config to see all available pages. Navigate to the desired page URL: browser action:"navigate" profile:"openclaw" targetId:"<targetId>" targetUrl:"<newPageUrl>" Wait for the page to load.
Meta Business Suite sessions expire periodically; re-login may be required. Facebook's DOM structure is complex and changes frequently. Prefer screenshots over DOM parsing when snapshots are unreliable. The inbox URL format: https://business.facebook.com/latest/inbox/all/?&asset_id=<PAGE_ID> Some pages may require specific permissions in Meta Business Suite.
Code helpers, APIs, CLIs, browser automation, testing, and developer operations.
Largest current source with strong distribution and engagement signals.