github / github/codespaces-django

gid

Abierto
#49 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
129
Forks
160
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

import { Vercel } from '@vercel/sdk';

const vercel = new Vercel({
bearerToken: process.env.VERCEL_TOKEN,
});

async function setupProjectWithGitHub() {
try {
// Create a new project with GH integration
const createResponse = await vercel.projects.createProject({
requestBody: {
name: 'advanced-project',
framework: 'nextjs',
gitRepository: {
repo: 'your-username-or-orgname/your-repo-name', //The repository should have been created before and the GH account is connected to your Vercel account
type: 'github',
},
},
});

console.log(`Project created: ${createResponse.id}`);

const envResponse = await vercel.projects.createProjectEnv({
idOrName: createResponse.id,
upsert: 'true',
requestBody: [
{
key: 'DATABASE_URL',
value: 'postgresql://user:pass@host:5432/db',
type: 'encrypted', // Encrypted when saved and viewable in the Vercel dashboard with correct permissions
target: ['production', 'preview'],
},
{
key: 'API_KEY',
value: 'your-api-key',
type: 'encrypted', // Encrypted when saved and viewable in the Vercel dashboard with correct permissions
target: ['production'],
},
{
key: 'API_URL',
value: 'your-api-url',
type: 'plain',
target: ['production', 'preview'],
},
],
});

console.log('Environment variables added:', envResponse.created);
} catch (error) {
console.error(
error instanceof Error ? `Error: ${error.message}` : String(error),
);
}
}

setupProjectWithGitHub();

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

The issue contains a JavaScript example using the Vercel SDK to create a project with GitHub integration and environment variables. No repository file, test, requested change, or completion criteria are identified, so the intended documentation scope and definition of done need clarification.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
github, javascript, nextjs, postgresql
Área
cloud
Tipo de issue
Documentación
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
20/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.