Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

153
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda