Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I import Penumbra properly in my Vue application? #256

Open
boriskogan81 opened this issue Jun 6, 2023 · 0 comments
Open

How do I import Penumbra properly in my Vue application? #256

boriskogan81 opened this issue Jun 6, 2023 · 0 comments

Comments

@boriskogan81
Copy link

I am building a Vue application with Quasar, using Vite to serve.

It is showing up as null in the console log.

Is there some other way I should be importing/instantiating?

<template>
  <q-card-section >
    <q-btn  @click="saveFile()">
      Try Penumbra
    </q-btn>
  </q-card-section>
</template>

<script>
import {
  ref,
  defineComponent,
  onMounted
} from "vue";
import { penumbra } from '@transcend-io/penumbra';

export default defineComponent ({
  name: "S3Display",
  setup() {
    const saveFile = async() => {
      try{
        console.log(penumbra);
        const file = await penumbra
          .get({
            url: 'https://ofanymdev.s3.eu-west-1.amazonaws.com/files/1685975915857-Capture.JPG',
            mimetype: 'image/jpeg',
            decryptionOptions: {
              key: '6245cb9b8dab1c1630bb3283063f963574d612ca6ec60bc8a5d1e07ddd3f7c53',
              iv: '6lNU+efb2da92cff888c9c295dc4ee682789c'
            },
          })
          await penumbra.save(file);
      }
      catch (e) {
        console.log("penumbra error: ", e)
      }
    }
    return {
      ref,
      saveFile
    }
  }
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant