[{"data":1,"prerenderedAt":582},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fphp-quickstart":3,"docs-nav":566},{"id":4,"title":5,"body":6,"description":558,"extension":559,"meta":560,"navigation":339,"order":128,"path":561,"section":562,"seo":563,"stem":564,"__hash__":565},"docs\u002Fdocs\u002Fphp-quickstart.md","PHP – Quick Start",{"type":7,"value":8,"toc":548},"minimark",[9,14,26,30,59,62,66,71,85,90,100,105,132,135,148,150,154,181,188,190,194,283,285,289,300,345,489,491,495,508,522,524,528,544],[10,11,13],"h2",{"id":12},"overview","Overview",[15,16,17,21,22,25],"p",{},[18,19,20],"code",{},"blockbots-standalone.php"," is a single-file PHP integration that protects any PHP page from bots, VPNs, and fake traffic. Drop it into your project, define your API key, and ",[18,23,24],{},"require"," it — the file runs automatically with no function calls needed.",[10,27,29],{"id":28},"requirements","Requirements",[31,32,33,42,49],"ul",{},[34,35,36,37,41],"li",{},"PHP ",[38,39,40],"strong",{},"7.2"," or higher",[34,43,44,45,48],{},"The ",[18,46,47],{},"sodium"," extension (enabled by default since PHP 7.2)",[34,50,51,52],{},"A BlockBots API key from ",[53,54,58],"a",{"href":55,"rel":56},"https:\u002F\u002Fpanel.blockbots.org",[57],"nofollow","panel.blockbots.org",[60,61],"hr",{},[10,63,65],{"id":64},"installation","Installation",[15,67,68],{},[38,69,70],{},"1. Download the file",[15,72,73,74,76,77,80,81,84],{},"Download ",[18,75,20],{}," from your dashboard at ",[53,78,58],{"href":55,"rel":79},[57]," under ",[38,82,83],{},"Settings → Integrations → PHP Standalone",".",[15,86,87],{},[38,88,89],{},"2. Place it in your project",[91,92,97],"pre",{"className":93,"code":95,"language":96},[94],"language-text","\u002Fyour-site\u002F\n  blockbots-standalone.php\n  index.php\n","text",[18,98,95],{"__ignoreMap":99},"",[15,101,102],{},[38,103,104],{},"3. Add two lines before any output",[91,106,110],{"className":107,"code":108,"language":109,"meta":99,"style":99},"language-php shiki shiki-themes github-light github-dark","\u003C?php\ndefine('BLOCKBOTS_API_KEY', 'YOUR_API_KEY');\nrequire_once __DIR__ . '\u002Fblockbots-standalone.php';\n","php",[18,111,112,120,126],{"__ignoreMap":99},[113,114,117],"span",{"class":115,"line":116},"line",1,[113,118,119],{},"\u003C?php\n",[113,121,123],{"class":115,"line":122},2,[113,124,125],{},"define('BLOCKBOTS_API_KEY', 'YOUR_API_KEY');\n",[113,127,129],{"class":115,"line":128},3,[113,130,131],{},"require_once __DIR__ . '\u002Fblockbots-standalone.php';\n",[15,133,134],{},"That's it. The file runs detection automatically the moment it is required — no function calls, no extra setup.",[136,137,138],"blockquote",{},[15,139,140,143,144,147],{},[38,141,142],{},"Get your API key"," from the dashboard at ",[53,145,58],{"href":55,"rel":146},[57]," under Settings → API Keys.",[60,149],{},[10,151,153],{"id":152},"how-it-works","How it works",[155,156,157,164,167,170],"ol",{},[34,158,159,160,163],{},"On each request the file checks for a valid ",[18,161,162],{},"__bbjwt"," cookie. Verified humans pass through instantly — no network call made.",[34,165,166],{},"If no valid cookie exists, the visitor is served a verification page. The BlockBots JS library runs a silent cloud check in the browser.",[34,168,169],{},"Verified humans receive a signed JWT cookie and the page reloads automatically. The process typically takes under 1–2 seconds.",[34,171,172,173,176,177,180],{},"Visitors with a ",[18,174,175],{},"__bb_decision"," block cookie receive a ",[18,178,179],{},"403 Access Denied"," page and never see your content.",[15,182,183,184,187],{},"XHR \u002F ",[18,185,186],{},"fetch"," requests bypass the verification page automatically so your API calls are never interrupted.",[60,189],{},[10,191,193],{"id":192},"full-example","Full example",[91,195,197],{"className":107,"code":196,"language":109,"meta":99,"style":99},"\u003C?php\ndefine('BLOCKBOTS_API_KEY', 'YOUR_API_KEY');\nrequire_once __DIR__ . '\u002Fblockbots-standalone.php';\n?>\n\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n\u003Chead>\n  \u003Cmeta charset=\"UTF-8\" \u002F>\n  \u003Ctitle>My Site\u003C\u002Ftitle>\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Ch1>Welcome!\u003C\u002Fh1>\n  \u003C!-- Protected content — bots never reach this -->\n\u003C\u002Fbody>\n\u003C\u002Fhtml>\n",[18,198,199,203,207,211,217,223,229,235,241,247,253,259,265,271,277],{"__ignoreMap":99},[113,200,201],{"class":115,"line":116},[113,202,119],{},[113,204,205],{"class":115,"line":122},[113,206,125],{},[113,208,209],{"class":115,"line":128},[113,210,131],{},[113,212,214],{"class":115,"line":213},4,[113,215,216],{},"?>\n",[113,218,220],{"class":115,"line":219},5,[113,221,222],{},"\u003C!DOCTYPE html>\n",[113,224,226],{"class":115,"line":225},6,[113,227,228],{},"\u003Chtml lang=\"en\">\n",[113,230,232],{"class":115,"line":231},7,[113,233,234],{},"\u003Chead>\n",[113,236,238],{"class":115,"line":237},8,[113,239,240],{},"  \u003Cmeta charset=\"UTF-8\" \u002F>\n",[113,242,244],{"class":115,"line":243},9,[113,245,246],{},"  \u003Ctitle>My Site\u003C\u002Ftitle>\n",[113,248,250],{"class":115,"line":249},10,[113,251,252],{},"\u003C\u002Fhead>\n",[113,254,256],{"class":115,"line":255},11,[113,257,258],{},"\u003Cbody>\n",[113,260,262],{"class":115,"line":261},12,[113,263,264],{},"  \u003Ch1>Welcome!\u003C\u002Fh1>\n",[113,266,268],{"class":115,"line":267},13,[113,269,270],{},"  \u003C!-- Protected content — bots never reach this -->\n",[113,272,274],{"class":115,"line":273},14,[113,275,276],{},"\u003C\u002Fbody>\n",[113,278,280],{"class":115,"line":279},15,[113,281,282],{},"\u003C\u002Fhtml>\n",[60,284],{},[10,286,288],{"id":287},"configuration","Configuration",[15,290,291,292,295,296,299],{},"Set any of these constants ",[38,293,294],{},"before"," the ",[18,297,298],{},"require_once"," to override the defaults:",[91,301,303],{"className":107,"code":302,"language":109,"meta":99,"style":99},"define('BLOCKBOTS_API_KEY',    'YOUR_API_KEY');\ndefine('BLOCKBOTS_DEBUG',        false);   \u002F\u002F true = skip IP-binding check on the JWT\ndefine('BLOCKBOTS_RETRIES',      2);       \u002F\u002F JS SDK retry attempts\ndefine('BLOCKBOTS_DELAY',        1000);    \u002F\u002F delay between retries (ms)\ndefine('BLOCKBOTS_TIMEOUT',      30000);   \u002F\u002F verification timeout (ms)\ndefine('BLOCKBOTS_SHOW_LOADING', true);    \u002F\u002F show loading overlay during verification\n\nrequire_once __DIR__ . '\u002Fblockbots-standalone.php';\n",[18,304,305,310,315,320,325,330,335,341],{"__ignoreMap":99},[113,306,307],{"class":115,"line":116},[113,308,309],{},"define('BLOCKBOTS_API_KEY',    'YOUR_API_KEY');\n",[113,311,312],{"class":115,"line":122},[113,313,314],{},"define('BLOCKBOTS_DEBUG',        false);   \u002F\u002F true = skip IP-binding check on the JWT\n",[113,316,317],{"class":115,"line":128},[113,318,319],{},"define('BLOCKBOTS_RETRIES',      2);       \u002F\u002F JS SDK retry attempts\n",[113,321,322],{"class":115,"line":213},[113,323,324],{},"define('BLOCKBOTS_DELAY',        1000);    \u002F\u002F delay between retries (ms)\n",[113,326,327],{"class":115,"line":219},[113,328,329],{},"define('BLOCKBOTS_TIMEOUT',      30000);   \u002F\u002F verification timeout (ms)\n",[113,331,332],{"class":115,"line":225},[113,333,334],{},"define('BLOCKBOTS_SHOW_LOADING', true);    \u002F\u002F show loading overlay during verification\n",[113,336,337],{"class":115,"line":231},[113,338,340],{"emptyLinePlaceholder":339},true,"\n",[113,342,343],{"class":115,"line":237},[113,344,131],{},[346,347,348,367],"table",{},[349,350,351],"thead",{},[352,353,354,358,361,364],"tr",{},[355,356,357],"th",{},"Constant",[355,359,360],{},"Type",[355,362,363],{},"Default",[355,365,366],{},"Description",[368,369,370,392,412,432,451,470],"tbody",{},[352,371,372,378,383,386],{},[373,374,375],"td",{},[18,376,377],{},"BLOCKBOTS_API_KEY",[373,379,380],{},[18,381,382],{},"string",[373,384,385],{},"—",[373,387,388,391],{},[38,389,390],{},"Required."," Your API key",[352,393,394,399,404,409],{},[373,395,396],{},[18,397,398],{},"BLOCKBOTS_DEBUG",[373,400,401],{},[18,402,403],{},"bool",[373,405,406],{},[18,407,408],{},"false",[373,410,411],{},"Skip IP binding check on the JWT cookie — useful for local dev behind NAT",[352,413,414,419,424,429],{},[373,415,416],{},[18,417,418],{},"BLOCKBOTS_RETRIES",[373,420,421],{},[18,422,423],{},"int",[373,425,426],{},[18,427,428],{},"2",[373,430,431],{},"Number of JS SDK retry attempts if verification fails",[352,433,434,439,443,448],{},[373,435,436],{},[18,437,438],{},"BLOCKBOTS_DELAY",[373,440,441],{},[18,442,423],{},[373,444,445],{},[18,446,447],{},"1000",[373,449,450],{},"Milliseconds between retries",[352,452,453,458,462,467],{},[373,454,455],{},[18,456,457],{},"BLOCKBOTS_TIMEOUT",[373,459,460],{},[18,461,423],{},[373,463,464],{},[18,465,466],{},"30000",[373,468,469],{},"Maximum time (ms) to wait for cloud verification",[352,471,472,477,481,486],{},[373,473,474],{},[18,475,476],{},"BLOCKBOTS_SHOW_LOADING",[373,478,479],{},[18,480,403],{},[373,482,483],{},[18,484,485],{},"true",[373,487,488],{},"Show animated loading overlay while verification runs",[60,490],{},[10,492,494],{"id":493},"disabling-protection-conditionally","Disabling protection conditionally",[15,496,497,498,501,502,504,505,507],{},"Define ",[18,499,500],{},"BLOCKBOTS"," as ",[18,503,408],{}," before the ",[18,506,298],{}," to bypass all checks for that request — useful for admin routes or health-check endpoints:",[91,509,511],{"className":107,"code":510,"language":109,"meta":99,"style":99},"define('BLOCKBOTS', false); \u002F\u002F skip all bot checks\nrequire_once __DIR__ . '\u002Fblockbots-standalone.php';\n",[18,512,513,518],{"__ignoreMap":99},[113,514,515],{"class":115,"line":116},[113,516,517],{},"define('BLOCKBOTS', false); \u002F\u002F skip all bot checks\n",[113,519,520],{"class":115,"line":122},[113,521,131],{},[60,523],{},[10,525,527],{"id":526},"next-steps","Next steps",[31,529,530,537],{},[34,531,532,533],{},"Protect WordPress instead → ",[53,534,536],{"href":535},"\u002Fdocs\u002Fwordpress-plugin","WordPress Plugin",[34,538,539,540],{},"Use the browser-side SDK → ",[53,541,543],{"href":542},"\u002Fdocs\u002Fjavascript-quickstart","JavaScript Quick Start",[545,546,547],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":99,"searchDepth":122,"depth":122,"links":549},[550,551,552,553,554,555,556,557],{"id":12,"depth":122,"text":13},{"id":28,"depth":122,"text":29},{"id":64,"depth":122,"text":65},{"id":152,"depth":122,"text":153},{"id":192,"depth":122,"text":193},{"id":287,"depth":122,"text":288},{"id":493,"depth":122,"text":494},{"id":526,"depth":122,"text":527},"Integrate BlockBots into any PHP site using blockbots-standalone.php — no framework or plugin required.","md",{},"\u002Fdocs\u002Fphp-quickstart","PHP Integration",{"title":5,"description":558},"docs\u002Fphp-quickstart","BHNhrIl1wulLTgiOgTZLiEm-EXbzJfxX3hQwoFlr968",[567,571,572,575,578,579],{"title":568,"path":569,"order":116,"section":570},"Getting Started","\u002Fdocs\u002Fgetting-started","Introduction",{"title":5,"path":561,"order":128,"section":562},{"title":573,"path":542,"order":219,"section":574},"JavaScript SDK – Quick Start","JavaScript SDK",{"title":576,"path":577,"order":225,"section":574},"JavaScript SDK – Reference","\u002Fdocs\u002Fjavascript-reference",{"title":536,"path":535,"order":231,"section":536},{"title":580,"path":581,"order":237,"section":536},"WordPress Plugin – Settings Guide","\u002Fdocs\u002Fwordpress-reference",1790770390588]