[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AP9F06WMH5Z1CF3XRRA39V":3,"skill-same:01M7AP9F06WMH5Z1CF3XRRA39V":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M7AP9F06WMH5Z1CF3XRRA39V","PocketBase SDK",null,"JavaScript SDK usage for PocketBase client applications. Use when calling PocketBase from frontend or Node.js, authenticating users, subscribing to realtime events, uploading files, or working with the PocketBase JS\u002FTS SDK. Covers CRUD, auth flows, authStore, realtime SSE, file handling, batch operations, and query syntax.","GongYuanCaiJi\u002Fdsh-claude-code-templates","GongYuanCaiJi","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F129952120?v=4","01M7AK39Q4W3VPF7C1K8M58BFX","劉昱廷 Yu-Ting Liu","01M7AK39QPS2RAJKRQY0EPQJPZ",0,"MIT","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fpocketbase\u002Fpb-sdk\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"PocketBase SDK\"\ndescription: \"JavaScript SDK usage for PocketBase client applications. Use when calling PocketBase from frontend or Node.js, authenticating users, subscribing to realtime events, uploading files, or working with the PocketBase JS\u002FTS SDK. Covers CRUD, auth flows, authStore, realtime SSE, file handling, batch operations, and query syntax.\"\n---\n\n# PocketBase JavaScript SDK\n\n## Installation & Setup\n\n```bash\nnpm install pocketbase\n# or\nyarn add pocketbase\n# or\n\u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fpocketbase@0.36.6\u002Fdist\u002Fpocketbase.umd.js\">\u003C\u002Fscript>\n```\n\n```js\nimport PocketBase from 'pocketbase'\n\nconst pb = new PocketBase('http:\u002F\u002F127.0.0.1:8090')\n```\n\n## CRUD Operations\n\n### List records\n\n```js\nconst records = await pb.collection('posts').getList(1, 20, {\n    filter: 'status = \"active\" && created > \"2024-01-01\"',\n    sort: '-created,title',\n    expand: 'author,tags',\n    fields: 'id,title,author,created',  \u002F\u002F partial response\n    skipTotal: true,  \u002F\u002F skip COUNT query for better performance\n})\n\n\u002F\u002F records.page, records.perPage, records.totalItems, records.totalPages, records.items\n```\n\n### Get full list (auto-paginate)\n\n```js\nconst allRecords = await pb.collection('posts').getFullList({\n    filter: 'status = \"active\"',\n    sort: '-created',\n    batch: 200,  \u002F\u002F records per request (default: 200)\n})\n```\n\n### View single record\n\n```js\nconst record = await pb.collection('posts').getOne('RECORD_ID', {\n    expand: 'author',\n})\n```\n\n### Get first matching record\n\n```js\nconst record = await pb.collection('posts').getFirstListItem('slug = \"my-post\"', {\n    expand: 'author',\n})\n```\n\n### Create record\n\n```js\nconst record = await pb.collection('posts').create({\n    title: 'My Post',\n    body: 'Content here',\n    author: 'USER_ID',\n    status: 'draft',\n})\n```\n\n### Update record\n\n```js\nconst record = await pb.collection('posts').update('RECORD_ID', {\n    title: 'Updated Title',\n    status: 'published',\n})\n```\n\n### Delete record\n\n```js\nawait pb.collection('posts').delete('RECORD_ID')\n```\n\n## Query Parameters\n\n### Filter syntax\n\nSame as API rules filter syntax. Common patterns:\n\n```js\n\u002F\u002F Equality\nfilter: 'status = \"active\"'\n\n\u002F\u002F Contains (LIKE)\nfilter: 'title ~ \"hello\"'\n\n\u002F\u002F Multi-relation contains\nfilter: 'tags ?= \"TAG_ID\"'\n\n\u002F\u002F Date comparison\nfilter: 'created > \"2024-01-01 00:00:00\"'\n\n\u002F\u002F Relative dates\nfilter: 'created > @now - 7d'\n\n\u002F\u002F Logical operators\nfilter: 'status = \"active\" && author = \"USER_ID\"'\nfilter: '(type = \"a\" || type = \"b\") && active = true'\n\n\u002F\u002F Null check\nfilter: 'parent = null'\nfilter: 'parent != null'\n```\n\n### Sort syntax\n\n```js\nsort: '-created'          \u002F\u002F descending by created\nsort: 'title'             \u002F\u002F ascending by title\nsort: '-created,title'    \u002F\u002F multi-field sort\nsort: '@random'           \u002F\u002F random order\n```\n\n### Expand relations\n\n```js\nexpand: 'author'                    \u002F\u002F single relation\nexpand: 'author,tags'               \u002F\u002F multiple relations\nexpand: 'author.team'               \u002F\u002F nested expand (author's team)\nexpand: 'comments_via_post'         \u002F\u002F back-relation (comments that reference this post)\nexpand: 'comments_via_post.author'  \u002F\u002F nested back-relation expand\n```\n\n### Fields (partial response)\n\n```js\nfields: 'id,title,created'\nfields: 'id,expand.author.name'     \u002F\u002F include expanded field\nfields: '*,expand.author.name'      \u002F\u002F all fields + specific expand\n```\n\n## Authentication\n\n### Email\u002Fpassword\n\n```js\nconst authData = await pb.collection('users').authWithPassword('user@example.com', 'password123')\n\u002F\u002F authData.token, authData.record\n```\n\n### OAuth2 (all-in-one)\n\n```js\n\u002F\u002F Opens popup\u002Fredirect for OAuth2 provider\nconst authData = await pb.collection('users').authWithOAuth2({ provider: 'google' })\n\u002F\u002F or with redirect\nconst authData = await pb.collection('users').authWithOAuth2({\n    provider: 'google',\n    urlCallback: (url) => { window.location.href = url }\n})\n```\n\n### OTP (one-time password)\n\n```js\n\u002F\u002F Step 1: Request OTP\nconst result = await pb.collection('users').requestOTP('user@example.com')\n\u002F\u002F result.otpId\n\n\u002F\u002F Step 2: Verify OTP\nconst authData = await pb.collection('users').authWithOTP(result.otpId, '123456')\n```\n\n### MFA (multi-factor authentication)\n\nMFA is triggered automatically when enabled. After primary auth returns a `mfaId`:\n\n```js\ntry {\n    await pb.collection('users').authWithPassword('user@example.com', 'password')\n} catch (err) {\n    if (err.response?.mfaId) {\n        \u002F\u002F Need second factor — e.g., OTP\n        const otpResult = await pb.collection('users').requestOTP('user@example.com')\n        await pb.collection('users').authWithOTP(otpResult.otpId, '123456', {\n            mfaId: err.response.mfaId\n        })\n    }\n}\n```\n\n### Auth store\n\n```js\npb.authStore.token       \u002F\u002F current JWT token\npb.authStore.record      \u002F\u002F current auth record\npb.authStore.isValid     \u002F\u002F token not expired\npb.authStore.isAdmin     \u002F\u002F deprecated — check record.collectionName === '_superusers'\npb.authStore.isSuperuser \u002F\u002F check if superuser\n\n\u002F\u002F Listen for auth changes\npb.authStore.onChange((token, record) => {\n    console.log('Auth changed:', record?.id)\n})\n\n\u002F\u002F Clear auth\npb.authStore.clear()\n\n\u002F\u002F Refresh auth (get fresh token + record)\nawait pb.collection('users').authRefresh()\n```\n\n### Password reset\n\n```js\n\u002F\u002F Request reset email\nawait pb.collection('users').requestPasswordReset('user@example.com')\n\n\u002F\u002F Confirm reset (usually from email link)\nawait pb.collection('users').confirmPasswordReset(token, newPassword, newPasswordConfirm)\n```\n\n### Email verification\n\n```js\nawait pb.collection('users').requestVerification('user@example.com')\nawait pb.collection('users').confirmVerification(token)\n```\n\n### Email change\n\n```js\nawait pb.collection('users').requestEmailChange('new@example.com')\nawait pb.collection('users').confirmEmailChange(token, password)\n```\n\n## Realtime (SSE)\n\n### Subscribe to record changes\n\n```js\n\u002F\u002F Subscribe to all changes in a collection\npb.collection('posts').subscribe('*', function(e) {\n    \u002F\u002F e.action: 'create' | 'update' | 'delete'\n    \u002F\u002F e.record: the affected record\n    console.log(e.action, e.record.id)\n}, {\n    expand: 'author',  \u002F\u002F expand relations in realtime events\n    filter: 'status = \"active\"',  \u002F\u002F only receive matching records\n})\n\n\u002F\u002F Subscribe to a specific record\npb.collection('posts').subscribe('RECORD_ID', function(e) {\n    console.log('Record changed:', e.record)\n})\n\n\u002F\u002F Unsubscribe\npb.collection('posts').unsubscribe('*')        \u002F\u002F from specific topic\npb.collection('posts').unsubscribe('RECORD_ID')\npb.collection('posts').unsubscribe()            \u002F\u002F from all collection topics\npb.realtime.unsubscribe()                       \u002F\u002F from everything\n```\n\n### Connection management\n\n```js\n\u002F\u002F The SDK auto-reconnects on disconnect\n\u002F\u002F You can listen for connect\u002Fdisconnect:\npb.realtime.onConnect = function() {\n    console.log('Connected')\n}\npb.realtime.onDisconnect = function() {\n    console.log('Disconnected')\n}\n```\n\n## File Upload & Download\n\n### Upload files\n\n```js\n\u002F\u002F Via FormData (browser)\nconst formData = new FormData()\nformData.append('title', 'My Post')\nformData.append('document', fileInput.files[0])\nformData.append('images', fileInput1.files[0])  \u002F\u002F multi-file\nformData.append('images', fileInput2.files[0])\n\nconst record = await pb.collection('posts').create(formData)\n\n\u002F\u002F Via object (Node.js or when you have the file as a Blob\u002FFile)\nconst record = await pb.collection('posts').create({\n    title: 'My Post',\n    document: new File([blob], 'file.pdf'),\n})\n```\n\n### Delete a file\n\n```js\n\u002F\u002F Set field to empty to delete\nawait pb.collection('posts').update('RECORD_ID', {\n    document: null,  \u002F\u002F deletes the file\n})\n\n\u002F\u002F For multi-file: remove specific file\nawait pb.collection('posts').update('RECORD_ID', {\n    'images-': ['filename_to_remove.jpg'],  \u002F\u002F minus suffix removes\n})\n```\n\n### Get file URL\n\n```js\nconst url = pb.files.getURL(record, record.document)\n\u002F\u002F https:\u002F\u002Fexample.com\u002Fapi\u002Ffiles\u002FCOLLECTION_ID\u002FRECORD_ID\u002Ffilename.pdf\n\n\u002F\u002F With thumbnail (for image fields)\nconst thumb = pb.files.getURL(record, record.cover, { thumb: '100x100' })\n\u002F\u002F Supported: WxH, WxHt (top), WxHb (bottom), WxHf (fit), 0xH, Wx0\n```\n\n### Protected files\n\nFor files in collections with view rules, include the auth token:\n\n```js\nconst url = pb.files.getURL(record, record.document, { token: pb.authStore.token })\n```\n\n## Batch Operations\n\nSend multiple create\u002Fupdate\u002Fdelete in one request (transactional):\n\n```js\nconst batch = pb.createBatch()\n\nbatch.collection('posts').create({ title: 'Post 1' })\nbatch.collection('posts').create({ title: 'Post 2' })\nbatch.collection('posts').update('RECORD_ID', { title: 'Updated' })\nbatch.collection('comments').delete('COMMENT_ID')\n\nconst results = await batch.send()\n\u002F\u002F results[0], results[1], ... correspond to each operation\n```\n\n## Error Handling\n\n```js\ntry {\n    const record = await pb.collection('posts').create(data)\n} catch (err) {\n    \u002F\u002F err.status — HTTP status code\n    \u002F\u002F err.response — full error response\n    \u002F\u002F err.response.message — error message\n    \u002F\u002F err.response.data — field-level validation errors\n    \u002F\u002F   e.g., { title: { code: \"validation_required\", message: \"Missing required value.\" } }\n    \u002F\u002F err.isAbort — true if request was cancelled\n\n    if (err.status === 400) {\n        \u002F\u002F Validation error\n        for (const [field, error] of Object.entries(err.response.data)) {\n            console.log(`${field}: ${error.message}`)\n        }\n    }\n}\n```\n\n## Advanced\n\n### Auto-cancellation\n\nBy default, duplicate pending requests to the same endpoint are auto-cancelled. Disable per-request:\n\n```js\nawait pb.collection('posts').getList(1, 20, {\n    requestKey: null,  \u002F\u002F disable auto-cancel for this request\n})\n\n\u002F\u002F Or use a custom key to group cancellations\nawait pb.collection('posts').getList(1, 20, {\n    requestKey: 'my-custom-key',\n})\n```\n\n### Custom headers\n\n```js\n\u002F\u002F Per-request\nawait pb.collection('posts').getList(1, 20, {\n    headers: { 'X-Custom': 'value' }\n})\n\n\u002F\u002F Global (all requests)\npb.beforeSend = function(url, options) {\n    options.headers['X-Custom'] = 'value'\n    return { url, options }\n}\n\n\u002F\u002F Intercept response\npb.afterSend = function(response, data) {\n    \u002F\u002F modify data if needed\n    return data\n}\n```\n\n### SSR \u002F Server-side\n\n```js\n\u002F\u002F Load auth from cookie (e.g., in Next.js\u002FSvelteKit)\npb.authStore.loadFromCookie(request.headers.get('cookie') || '')\n\n\u002F\u002F Export auth to cookie\nconst cookie = pb.authStore.exportToCookie({ httpOnly: false })\nresponse.headers.set('set-cookie', cookie)\n```\n\n### Sending as superuser\n\n```js\nconst pb = new PocketBase('http:\u002F\u002F127.0.0.1:8090')\nawait pb.collection('_superusers').authWithPassword('admin@example.com', 'password')\n\u002F\u002F Now all requests are authenticated as superuser\n```\n","# PocketBase JavaScript SDK\n\n## Installation & Setup\n\n```bash\nnpm install pocketbase\n# or\nyarn add pocketbase\n# or\n\u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fpocketbase@0.36.6\u002Fdist\u002Fpocketbase.umd.js\">\u003C\u002Fscript>\n```\n\n```js\nimport PocketBase from 'pocketbase'\n\nconst pb = new PocketBase('http:\u002F\u002F127.0.0.1:8090')\n```\n\n## CRUD Operations\n\n### List records\n\n```js\nconst records = await pb.collection('posts').getList(1, 20, {\n    filter: 'status = \"active\" && created > \"2024-01-01\"',\n    sort: '-created,title',\n    expand: 'author,tags',\n    fields: 'id,title,author,created',  \u002F\u002F partial response\n    skipTotal: true,  \u002F\u002F skip COUNT query for better performance\n})\n\n\u002F\u002F records.page, records.perPage, records.totalItems, records.totalPages, records.items\n```\n\n### Get full list (auto-paginate)\n\n```js\nconst allRecords = await pb.collection('posts').getFullList({\n    filter: 'status = \"active\"',\n    sort: '-created',\n    batch: 200,  \u002F\u002F records per request (default: 200)\n})\n```\n\n### View single record\n\n```js\nconst record = await pb.collection('posts').getOne('RECORD_ID', {\n    expand: 'author',\n})\n```\n\n### Get first matching record\n\n```js\nconst record = await pb.collection('posts').getFirstListItem('slug = \"my-post\"', {\n    expand: 'author',\n})\n```\n\n### Create record\n\n```js\nconst record = await pb.collection('posts').create({\n    title: 'My Post',\n    body: 'Content here',\n    author: 'USER_ID',\n    status: 'draft',\n})\n```\n\n### Update record\n\n```js\nconst record = await pb.collection('posts').update('RECORD_ID', {\n    title: 'Updated Title',\n    status: 'published',\n})\n```\n\n### Delete record\n\n```js\nawait pb.collection('posts').delete('RECORD_ID')\n```\n\n## Query Parameters\n\n### Filter syntax\n\nSame as API rules filter syntax. Common patterns:\n\n```js\n\u002F\u002F Equality\nfilter: 'status = \"active\"'\n\n\u002F\u002F Contains (LIKE)\nfilter: 'title ~ \"hello\"'\n\n\u002F\u002F Multi-relation contains\nfilter: 'tags ?= \"TAG_ID\"'\n\n\u002F\u002F Date comparison\nfilter: 'created > \"2024-01-01 00:00:00\"'\n\n\u002F\u002F Relative dates\nfilter: 'created > @now - 7d'\n\n\u002F\u002F Logical operators\nfilter: 'status = \"active\" && author = \"USER_ID\"'\nfilter: '(type = \"a\" || type = \"b\") && active = true'\n\n\u002F\u002F Null check\nfilter: 'parent = null'\nfilter: 'parent != null'\n```\n\n### Sort syntax\n\n```js\nsort: '-created'          \u002F\u002F descending by created\nsort: 'title'             \u002F\u002F ascending by title\nsort: '-created,title'    \u002F\u002F multi-field sort\nsort: '@random'           \u002F\u002F random order\n```\n\n### Expand relations\n\n```js\nexpand: 'author'                    \u002F\u002F single relation\nexpand: 'author,tags'               \u002F\u002F multiple relations\nexpand: 'author.team'               \u002F\u002F nested expand (author's team)\nexpand: 'comments_via_post'         \u002F\u002F back-relation (comments that reference this post)\nexpand: 'comments_via_post.author'  \u002F\u002F nested back-relation expand\n```\n\n### Fields (partial response)\n\n```js\nfields: 'id,title,created'\nfields: 'id,expand.author.name'     \u002F\u002F include expanded field\nfields: '*,expand.author.name'      \u002F\u002F all fields + specific expand\n```\n\n## Authentication\n\n### Email\u002Fpassword\n\n```js\nconst authData = await pb.collection('users').authWithPassword('user@example.com', 'password123')\n\u002F\u002F authData.token, authData.record\n```\n\n### OAuth2 (all-in-one)\n\n```js\n\u002F\u002F Opens popup\u002Fredirect for OAuth2 provider\nconst authData = await pb.collection('users').authWithOAuth2({ provider: 'google' })\n\u002F\u002F or with redirect\nconst authData = await pb.collection('users').authWithOAuth2({\n    provider: 'google',\n    urlCallback: (url) => { window.location.href = url }\n})\n```\n\n### OTP (one-time password)\n\n```js\n\u002F\u002F Step 1: Request OTP\nconst result = await pb.collection('users').requestOTP('user@example.com')\n\u002F\u002F result.otpId\n\n\u002F\u002F Step 2: Verify OTP\nconst authData = await pb.collection('users').authWithOTP(result.otpId, '123456')\n```\n\n### MFA (multi-factor authentication)\n\nMFA is triggered automatically when enabled. After primary auth returns a `mfaId`:\n\n```js\ntry {\n    await pb.collection('users').authWithPassword('user@example.com', 'password')\n} catch (err) {\n    if (err.response?.mfaId) {\n        \u002F\u002F Need second factor — e.g., OTP\n        const otpResult = await pb.collection('users').requestOTP('user@example.com')\n        await pb.collection('users').authWithOTP(otpResult.otpId, '123456', {\n            mfaId: err.response.mfaId\n        })\n    }\n}\n```\n\n### Auth store\n\n```js\npb.authStore.token       \u002F\u002F current JWT token\npb.authStore.record      \u002F\u002F current auth record\npb.authStore.isValid     \u002F\u002F token not expired\npb.authStore.isAdmin     \u002F\u002F deprecated — check record.collectionName === '_superusers'\npb.authStore.isSuperuser \u002F\u002F check if superuser\n\n\u002F\u002F Listen for auth changes\npb.authStore.onChange((token, record) => {\n    console.log('Auth changed:', record?.id)\n})\n\n\u002F\u002F Clear auth\npb.authStore.clear()\n\n\u002F\u002F Refresh auth (get fresh token + record)\nawait pb.collection('users').authRefresh()\n```\n\n### Password reset\n\n```js\n\u002F\u002F Request reset email\nawait pb.collection('users').requestPasswordReset('user@example.com')\n\n\u002F\u002F Confirm reset (usually from email link)\nawait pb.collection('users').confirmPasswordReset(token, newPassword, newPasswordConfirm)\n```\n\n### Email verification\n\n```js\nawait pb.collection('users').requestVerification('user@example.com')\nawait pb.collection('users').confirmVerification(token)\n```\n\n### Email change\n\n```js\nawait pb.collection('users').requestEmailChange('new@example.com')\nawait pb.collection('users').confirmEmailChange(token, password)\n```\n\n## Realtime (SSE)\n\n### Subscribe to record changes\n\n```js\n\u002F\u002F Subscribe to all changes in a collection\npb.collection('posts').subscribe('*', function(e) {\n    \u002F\u002F e.action: 'create' | 'update' | 'delete'\n    \u002F\u002F e.record: the affected record\n    console.log(e.action, e.record.id)\n}, {\n    expand: 'author',  \u002F\u002F expand relations in realtime events\n    filter: 'status = \"active\"',  \u002F\u002F only receive matching records\n})\n\n\u002F\u002F Subscribe to a specific record\npb.collection('posts').subscribe('RECORD_ID', function(e) {\n    console.log('Record changed:', e.record)\n})\n\n\u002F\u002F Unsubscribe\npb.collection('posts').unsubscribe('*')        \u002F\u002F from specific topic\npb.collection('posts').unsubscribe('RECORD_ID')\npb.collection('posts').unsubscribe()            \u002F\u002F from all collection topics\npb.realtime.unsubscribe()                       \u002F\u002F from everything\n```\n\n### Connection management\n\n```js\n\u002F\u002F The SDK auto-reconnects on disconnect\n\u002F\u002F You can listen for connect\u002Fdisconnect:\npb.realtime.onConnect = function() {\n    console.log('Connected')\n}\npb.realtime.onDisconnect = function() {\n    console.log('Disconnected')\n}\n```\n\n## File Upload & Download\n\n### Upload files\n\n```js\n\u002F\u002F Via FormData (browser)\nconst formData = new FormData()\nformData.append('title', 'My Post')\nformData.append('document', fileInput.files[0])\nformData.append('images', fileInput1.files[0])  \u002F\u002F multi-file\nformData.append('images', fileInput2.files[0])\n\nconst record = await pb.collection('posts').create(formData)\n\n\u002F\u002F Via object (Node.js or when you have the file as a Blob\u002FFile)\nconst record = await pb.collection('posts').create({\n    title: 'My Post',\n    document: new File([blob], 'file.pdf'),\n})\n```\n\n### Delete a file\n\n```js\n\u002F\u002F Set field to empty to delete\nawait pb.collection('posts').update('RECORD_ID', {\n    document: null,  \u002F\u002F deletes the file\n})\n\n\u002F\u002F For multi-file: remove specific file\nawait pb.collection('posts').update('RECORD_ID', {\n    'images-': ['filename_to_remove.jpg'],  \u002F\u002F minus suffix removes\n})\n```\n\n### Get file URL\n\n```js\nconst url = pb.files.getURL(record, record.document)\n\u002F\u002F https:\u002F\u002Fexample.com\u002Fapi\u002Ffiles\u002FCOLLECTION_ID\u002FRECORD_ID\u002Ffilename.pdf\n\n\u002F\u002F With thumbnail (for image fields)\nconst thumb = pb.files.getURL(record, record.cover, { thumb: '100x100' })\n\u002F\u002F Supported: WxH, WxHt (top), WxHb (bottom), WxHf (fit), 0xH, Wx0\n```\n\n### Protected files\n\nFor files in collections with view rules, include the auth token:\n\n```js\nconst url = pb.files.getURL(record, record.document, { token: pb.authStore.token })\n```\n\n## Batch Operations\n\nSend multiple create\u002Fupdate\u002Fdelete in one request (transactional):\n\n```js\nconst batch = pb.createBatch()\n\nbatch.collection('posts').create({ title: 'Post 1' })\nbatch.collection('posts').create({ title: 'Post 2' })\nbatch.collection('posts').update('RECORD_ID', { title: 'Updated' })\nbatch.collection('comments').delete('COMMENT_ID')\n\nconst results = await batch.send()\n\u002F\u002F results[0], results[1], ... correspond to each operation\n```\n\n## Error Handling\n\n```js\ntry {\n    const record = await pb.collection('posts').create(data)\n} catch (err) {\n    \u002F\u002F err.status — HTTP status code\n    \u002F\u002F err.response — full error response\n    \u002F\u002F err.response.message — error message\n    \u002F\u002F err.response.data — field-level validation errors\n    \u002F\u002F   e.g., { title: { code: \"validation_required\", message: \"Missing required value.\" } }\n    \u002F\u002F err.isAbort — true if request was cancelled\n\n    if (err.status === 400) {\n        \u002F\u002F Validation error\n        for (const [field, error] of Object.entries(err.response.data)) {\n            console.log(`${field}: ${error.message}`)\n        }\n    }\n}\n```\n\n## Advanced\n\n### Auto-cancellation\n\nBy default, duplicate pending requests to the same endpoint are auto-cancelled. Disable per-request:\n\n```js\nawait pb.collection('posts').getList(1, 20, {\n    requestKey: null,  \u002F\u002F disable auto-cancel for this request\n})\n\n\u002F\u002F Or use a custom key to group cancellations\nawait pb.collection('posts').getList(1, 20, {\n    requestKey: 'my-custom-key',\n})\n```\n\n### Custom headers\n\n```js\n\u002F\u002F Per-request\nawait pb.collection('posts').getList(1, 20, {\n    headers: { 'X-Custom': 'value' }\n})\n\n\u002F\u002F Global (all requests)\npb.beforeSend = function(url, options) {\n    options.headers['X-Custom'] = 'value'\n    return { url, options }\n}\n\n\u002F\u002F Intercept response\npb.afterSend = function(response, data) {\n    \u002F\u002F modify data if needed\n    return data\n}\n```\n\n### SSR \u002F Server-side\n\n```js\n\u002F\u002F Load auth from cookie (e.g., in Next.js\u002FSvelteKit)\npb.authStore.loadFromCookie(request.headers.get('cookie') || '')\n\n\u002F\u002F Export auth to cookie\nconst cookie = pb.authStore.exportToCookie({ httpOnly: false })\nresponse.headers.set('set-cookie', cookie)\n```\n\n### Sending as superuser\n\n```js\nconst pb = new PocketBase('http:\u002F\u002F127.0.0.1:8090')\nawait pb.collection('_superusers').authWithPassword('admin@example.com', 'password')\n\u002F\u002F Now all requests are authenticated as superuser\n```\n",{"name":5,"description":7},"main","51493f354fd03e3f941d4df7fd64c0b8c7a2632d","skills\u002Fpocketbase\u002Fpb-sdk","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi","漏洞研究、根因分析、黑箱測試｜做 AI agent 工具｜Vulnerability research, root-cause analysis, AI agent tooling","2026-08-16 02:24:07",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add GongYuanCaiJi\u002Fdsh-claude-code-templates --skill \"PocketBase SDK\"",{"tool":37,"command":38},"bunx","bunx skills add GongYuanCaiJi\u002Fdsh-claude-code-templates --skill \"PocketBase SDK\"",{"tool":40,"command":41},"pnpm","pnpm dlx skills add GongYuanCaiJi\u002Fdsh-claude-code-templates --skill \"PocketBase SDK\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fpocketbase\u002Fpb-sdk\u002FSKILL.md",true,[],[46,53,62,69,76,83],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M7ARMYTZ5D4B7N5SKFXV345V","zapier-make-patterns","No-code automation democratizes workflow building. Zapier and Make (formerly Integromat) let non-developers automate business processes without writing code. But no-code doesn't mean no-complexity - these platforms have their own patterns, pitfalls, and breaking points.  This skill covers when to use which platform, how to build reliable automations, and when to graduate to code-based solutions. Key insight: Zapier optimizes for simplicity and integrations (7000+ apps), Make optimizes for power","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fzapier-make-patterns\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":58,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7ARMX1BVNEAR98SBANMDF2V","yeet","Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).","Apache-2.0","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7ARMPR4RQ417MG1HMPGNQHH","workflow-automation","Workflow automation is the infrastructure that makes AI agents reliable. Without durable execution, a network hiccup during a 10-step payment flow means lost money and angry customers. With it, workflows resume exactly where they left off.  This skill covers the platforms (n8n, Temporal, Inngest) and patterns (sequential, parallel, orchestrator-worker) that turn brittle scripts into production-grade automation.  Key insight: The platforms make different tradeoffs. n8n optimizes for accessibility","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fworkflow-automation\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7ARMHBERDMKGDMV7K6MQ6YP","trigger-dev","Trigger.dev expert for background jobs, AI workflows, and reliable async execution with excellent developer experience and TypeScript-first design. Use when: trigger.dev, trigger dev, background task, ai background job, long running task.","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Ftrigger-dev\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7ARME0A7KFT330Q2H25HE2B","slack-automation","Automate Slack workspace operations including messaging, search, channel management, and reaction workflows through Composio's Slack toolkit.","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fslack-automation\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7ARM8D87V18WDG0GEZS11ZT","planning-with-files","Transforms workflow to use Manus-style persistent markdown files for planning, progress tracking, and knowledge storage. Use when starting complex tasks, multi-step projects, research tasks, or when the user mentions planning, organizing work, tracking progress, or wants structured output.","https:\u002F\u002Fgithub.com\u002FGongYuanCaiJi\u002Fdsh-claude-code-templates\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-automation\u002Fplanning-with-files\u002FSKILL.md",[],[]]