Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

155
Vistas
How to access my Stripe secret from azure key vault to inject into checkout.js

I'm developing a web app in dotnet 6 C# core razor pages. I have setup an Azure key vault with my Stripe Api Key and Publishable Key. I use the following code to access the key from the Key Vault.

public readonly IConfiguration _configuration;
PublicKey = _configuration["PublishableKey"].ToString();

This code I have tested and it does return the Publishable Key. I then need to inject that key into a javascript file checkout.js.

const stripe = Stripe('');

I tried this in the cshtml file,

@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@Configuration["PublishableKey"].ToString()

That worked in the cshtml file. I then tried this in the javerscript file checkout.js.

 const stripe = Stripe('@Configuration["PublishableKey"].ToString()')

I also tried.

@Model.PublicKey

But neither returned the key. How do I reference this key in the javascript file? Your help would be appreciated Thank-you.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda