본문으로 건너뛰기
아우라베이스 로고
아우라베이스

대량 사용자 가져오기

레거시 bcrypt 또는 최신 Argon2id 비밀번호 해시를 사용하여 배치당 최대 1,000명의 사용자를 가져올 수 있습니다. 다음 로그인 시 Argon2id로 투명하게 업그레이드됩니다.

방법 가이드5분 읽기레벨 중급

이 번역 이후 영어 소스가 변경되었습니다. 일부 정보는 최신 정보가 아닐 수 있습니다.
이 페이지는 자동으로 번역되었습니다. 영어 버전은 권위가 있습니다.

Importing users from another platform#

When migrating from Supabase, Firebase, Auth0, or a custom authentication database, users expect their existing passwords to keep working without a global password reset.

Aurabase provides a high-throughput bulk import endpoint (POST /v1/auth/admin/users/import) capable of ingesting up to 1,000 users per request. The operation returns an itemized status report so invalid records do not block the rest of the batch.

Supported password hashes and transparent upgrade#

The import endpoint supports the following password hashing algorithms:

AlgorithmIdentifiersBehavior
Argon2id$argon2id$v=19$m=...Verified directly using OWASP parameters.
bcrypt$2a$, $2b$, $2y$Verified on login and transparently re-encoded to Argon2id upon first successful authentication.

If no password_hash is provided for a user, the account is created without a password. The user can authenticate using Magic Links, Email/SMS OTP, or a password reset link.

Bulk import endpoint#

Requires administrator authorization (service_role key).

curl -X POST "$NEXT_PUBLIC_AURABASE_URL/v1/auth/admin/users/import" \
  -H "apikey: $AURABASE_SERVICE_ROLE_KEY" \
  -H "Authorization: Bearer $AURABASE_SERVICE_ROLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "users": [
      {
        "email": "[email protected]",
        "email_verified": true,
        "password_hash": "$2b$12$e8kPM4QJ8a2x4K7hM0uL.OeQ7f...",
        "name": "Alice Johnson",
        "user_metadata": { "department": "Engineering" }
      },
      {
        "email": "[email protected]",
        "email_verified": false,
        "password_hash": "$argon2id$v=19$m=65536,t=3,p=4$..."
      }
    ]
  }'

Response (200 OK)

The response details the total number of records processed along with an itemized report:

{
  "data": {
    "created": 2,
    "skipped": 0,
    "errors": 0,
    "report": [
      {
        "index": 0,
        "email": "[email protected]",
        "status": "created",
        "id": "e3b0c442-98fc-1c14-9afb-f4c599684824"
      },
      {
        "index": 1,
        "email": "[email protected]",
        "status": "created",
        "id": "7d2b5129-3bdf-48bc-8919-4b684df69921"
      }
    ]
  }
}

If an email already exists in the project, it is marked as skipped rather than raising a fatal error.

TypeScript SDK#

Use authAdmin.importUsers():

import { createClient } from '@aurabase/aurabase-js'

const aura = createClient(process.env.NEXT_PUBLIC_AURABASE_URL!, process.env.AURABASE_SERVICE_ROLE_KEY!)

const usersToImport = [
  {
    email: '[email protected]',
    emailVerified: true,
    passwordHash: '$2b$12$e8kPM4QJ8a2x4...',
    name: 'User One',
    userMetadata: { plan: 'pro' },
  },
  {
    email: '[email protected]',
    emailVerified: false,
    passwordHash: '$argon2id$v=19$m=65536,t=3,p=4$...',
    name: 'User Two',
  },
]

const { data, error } = await aura.authAdmin.importUsers(usersToImport)

if (error) {
  console.error('Import failed:', error.message)
} else {
  console.log(`Import summary: ${data.created} created, ${data.skipped} skipped, ${data.errors} errors`)

  for (const item of data.report) {
    if (item.status === 'error') {
      console.warn(`Row ${item.index} (${item.email}) error: ${item.error}`)
    }
  }
}

Import via Aurabase Studio#

You can also import users directly through the web interface:

  1. Navigate to Authentication › Users in your project dashboard.
  2. Click the Import users button in the top toolbar.
  3. Choose JSON or CSV format. You can click Insert sample to inspect the expected schema.
  4. Paste your data and click Start Import.
  5. Inspect the batch summary and row-by-row status report.
@aurabase/aurabase-js@0.7.5 · aura@0.3.4↗ 문제 신고