{"_id":"@caleblawson/auth-supabase","name":"@caleblawson/auth-supabase","dist-tags":{"latest":"0.10.1"},"versions":{"0.10.1":{"name":"@caleblawson/auth-supabase","version":"0.10.1","description":"Mastra Supabase Auth integration","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"license":"Elastic-2.0","dependencies":{"@supabase/supabase-js":"^2.50.0"},"devDependencies":{"@types/node":"^20.19.0","eslint":"^9.28.0","tsup":"^8.5.0","typescript":"^5.8.3","vitest":"^2.1.9","@internal/lint":"0.0.13","@mastra/core":"npm:@caleblawson/core@0.10.7-alpha.0"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake","build:watch":"pnpm build --watch","test":"vitest run","lint":"eslint ."},"gitHead":"c31e90130a5c9765c23f688ecea70adc6164543d","_id":"@caleblawson/auth-supabase@0.10.1","_integrity":"sha512-xuvJFiSqXu8C4vTYMpw1OCOB9YEaTsT3jDuFNo5Zoz83/4RigTeY9cl5f7Fi4NmVJRx/l/k1kwHNrEGzeqqqgw==","_resolved":"C:\\Users\\caleb\\AppData\\Local\\Temp\\f1c1cad393b69cc5a3860b3872c884b8\\caleblawson-auth-supabase-0.10.1.tgz","_from":"file:caleblawson-auth-supabase-0.10.1.tgz","_nodeVersion":"21.2.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-xuvJFiSqXu8C4vTYMpw1OCOB9YEaTsT3jDuFNo5Zoz83/4RigTeY9cl5f7Fi4NmVJRx/l/k1kwHNrEGzeqqqgw==","shasum":"bfef38d46320fdc2bc304463784a23c4a2b56351","tarball":"https://registry.npmjs.org/@caleblawson/auth-supabase/-/auth-supabase-0.10.1.tgz","fileCount":23,"unpackedSize":119468,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFblZg0qps0b7euLXkAT6w0g/0JMNH+Rpgwl93L3FQCSAiBbYq2o3rEbZgJHa72kJ1kp71kK4K4Q6PoZavhwfkc/CA=="}]},"_npmUser":{"name":"caleblawson","email":"caleb.lawson@dynapt.com","actor":{"name":"caleblawson","email":"caleb.lawson@dynapt.com","type":"user"}},"directories":{},"maintainers":[{"name":"caleblawson","email":"caleb.lawson@dynapt.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auth-supabase_0.10.1_1750378172153_0.5363978543214709"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-20T00:09:32.039Z","0.10.1":"2025-06-20T00:09:32.349Z","modified":"2025-06-20T00:09:32.625Z"},"maintainers":[{"name":"caleblawson","email":"caleb.lawson@dynapt.com"}],"description":"Mastra Supabase Auth integration","license":"Elastic-2.0","readme":"# @mastra/auth-supabase\r\n\r\nA Supabase authentication integration for Mastra, providing seamless authentication and authorization capabilities using Supabase's authentication system.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @mastra/auth-supabase\r\n# or\r\nyarn add @mastra/auth-supabase\r\n# or\r\npnpm add @mastra/auth-supabase\r\n```\r\n\r\n## Usage\r\n\r\n```typescript\r\nimport { Mastra } from '@mastra/core';\r\nimport { MastraAuthSupabase } from '@mastra/auth-supabase';\r\n\r\n// Initialize with environment variables\r\nconst auth = new MastraAuthSupabase();\r\n\r\n// Or initialize with explicit configuration\r\nconst auth = new MastraAuthSupabase({\r\n  url: 'your-supabase-url',\r\n  anonKey: 'your-supabase-anon-key',\r\n});\r\n\r\n// Enable auth in Mastra\r\nconst mastra = new Mastra({\r\n  ...\r\n  server: {\r\n    experimental_auth: auth,\r\n  },\r\n});\r\n```\r\n\r\n## Configuration\r\n\r\nThe package can be configured in two ways:\r\n\r\n1. **Environment Variables**:\r\n\r\n   - `SUPABASE_URL`: Your Supabase project URL\r\n   - `SUPABASE_ANON_KEY`: Your Supabase anonymous key\r\n\r\n2. **Constructor Options**:\r\n   ```typescript\r\n   interface MastraAuthSupabaseOptions {\r\n     url?: string;\r\n     anonKey?: string;\r\n   }\r\n   ```\r\n\r\n## Features\r\n\r\n- **Authentication**: Verifies user tokens and retrieves user information from Supabase\r\n- **Authorization**: Checks user permissions based on their role in Supabase\r\n- **Type Safety**: Full TypeScript support with proper type definitions\r\n- **Environment Variable Support**: Easy configuration through environment variables\r\n\r\n## API\r\n\r\n### `authenticateToken(token: string)`\r\n\r\nAuthenticates a user token and returns the user information if valid.\r\n\r\n### `authorizeUser(user: User)`\r\n\r\nChecks if a user has the required permissions (currently checks for admin status).\r\n\r\n## Requirements\r\n\r\n- Node.js 16 or higher\r\n- Supabase project with authentication enabled\r\n- Supabase URL and anonymous key\r\n\r\n## License\r\n\r\nElastic-2.0\r\n","readmeFilename":"README.md","_rev":"1-feaa2e53608a2a6ef3d33fec4f487f44"}